From 2bc40d4bdd254e7e3507ef90a63d30eda29a7ae8 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Mon, 3 Mar 2025 14:24:57 +0100 Subject: [PATCH 01/17] chore: setup release for v6 rc --- .github/workflows/workflow.yml | 6 ++---- package.json | 20 +++++--------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c5d925d9..dc95e8ca 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -3,13 +3,11 @@ on: push: branches: - master - - angular-19 - - test-update - - fix-voice-recording + - 6.x.x-rc pull_request: branches: - master - - 5.x.x-beta + - 6.x.x-rc jobs: workflow: runs-on: ubuntu-latest diff --git a/package.json b/package.json index 608ad422..a4dd5d60 100644 --- a/package.json +++ b/package.json @@ -41,22 +41,12 @@ "branches": [ "master", { - "name": "test-update", - "prerelease": true, - "channel": "beta" - }, - { - "name": "fix-voice-recording", - "prerelease": true, - "channel": "beta" - }, - { - "name": "5.x.x-beta", - "prerelease": true, - "channel": "beta" + "name": "6.x.x-rc", + "prerelease": "rc", + "channel": "rc" } ], - "dryRun": false, + "dryRun": true, "plugins": [ [ "@semantic-release/commit-analyzer", @@ -80,7 +70,7 @@ "@semantic-release/npm", { "pkgRoot": "./dist/stream-chat-angular", - "npmPublish": true + "npmPublish": false } ], [ From a224563204576f288c4aac230261cedb256de509 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Mon, 3 Mar 2025 17:04:51 +0100 Subject: [PATCH 02/17] feat: drop generics for custom typing BREAKING CHANGE: stream-chat types are no longer generic, see how you can type your custom types in the SDK v6 upgrade guide --- package-lock.json | 246 +++++++++----- package.json | 2 +- .../message-action.component.ts | 9 +- .../message-text/message-text.component.ts | 8 +- projects/stream-chat-angular/package.json | 2 +- .../lib/attachment-configuration.service.ts | 27 +- .../attachment-list.component.html | 12 +- .../attachment-list.component.spec.ts | 18 +- .../attachment-list.component.ts | 50 +-- .../src/lib/attachment.service.spec.ts | 5 +- .../src/lib/attachment.service.ts | 22 +- .../avatar-placeholder.component.spec.ts | 3 +- .../avatar-placeholder.component.ts | 11 +- .../src/lib/avatar/avatar.component.ts | 10 +- .../channel-header.component.spec.ts | 5 +- .../channel-header.component.ts | 8 +- .../channel-list/channel-list.component.ts | 6 +- .../channel-preview.component.spec.ts | 3 +- .../channel-preview.component.ts | 9 +- .../src/lib/channel-query.ts | 21 +- .../src/lib/channel.service.spec.ts | 218 ++++++------ .../src/lib/channel.service.thread.spec.ts | 86 ++--- .../src/lib/channel.service.ts | 318 +++++++++--------- .../src/lib/chat-client.service.spec.ts | 7 +- .../src/lib/chat-client.service.ts | 65 ++-- .../src/lib/custom-templates.service.ts | 10 +- .../src/lib/get-channel-display-text.spec.ts | 9 +- .../src/lib/get-channel-display-text.ts | 5 +- .../src/lib/get-message-translation.ts | 12 +- .../message-actions-box.component.spec.ts | 7 +- .../src/lib/message-actions.service.ts | 40 +-- .../autocomplete-textarea.component.spec.ts | 3 +- .../autocomplete-textarea.component.ts | 6 +- .../message-input.component.spec.ts | 28 +- .../message-input/message-input.component.ts | 5 +- .../message-list.component.spec.ts | 5 +- .../message-list/message-list.component.ts | 9 +- .../src/lib/message-preview.spec.ts | 32 +- .../src/lib/message-preview.ts | 20 +- .../message-reactions-selector.component.ts | 4 +- .../message-reactions.component.ts | 6 +- .../message-text/message-text.component.ts | 13 +- .../src/lib/message.service.ts | 9 +- .../src/lib/message/message.component.spec.ts | 13 +- .../src/lib/message/message.component.ts | 3 +- .../src/lib/mocks/index.ts | 24 +- .../src/lib/read-by.spec.ts | 5 +- .../stream-chat-angular/src/lib/read-by.ts | 8 +- .../src/lib/thread/thread.component.spec.ts | 5 +- .../src/lib/thread/thread.component.ts | 8 +- projects/stream-chat-angular/src/lib/types.ts | 204 ++++------- .../src/lib/user-list/user-list.component.ts | 3 +- .../voice-recording.component.ts | 3 +- .../stream-chat-angular/src/public-api.ts | 22 +- .../stream-chat-angular/tsconfig.spec.json | 2 +- 55 files changed, 806 insertions(+), 888 deletions(-) diff --git a/package-lock.json b/package-lock.json index a976f80e..6111606b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "pretty-bytes": "^6.1.1", "rxjs": "~7.4.0", "starwars-names": "^1.6.0", - "stream-chat": "^8.44.0", + "stream-chat": "9.0.0-rc.5", "ts-node": "^10.9.2", "tslib": "^2.3.0", "uuid": "^9.0.1", @@ -3170,6 +3170,7 @@ "version": "7.20.13", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz", "integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==", + "dev": true, "dependencies": { "regenerator-runtime": "^0.13.11" }, @@ -5639,10 +5640,12 @@ "dev": true }, "node_modules/@types/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.9.tgz", + "integrity": "sha512-uoe+GxEuHbvy12OUQct2X9JenKM3qAscquYymuQN4fMWG9DBQtykrQEFcAbVACF7qaLw9BePSodUL0kquqBJpQ==", + "license": "MIT", "dependencies": { + "@types/ms": "*", "@types/node": "*" } }, @@ -5652,6 +5655,12 @@ "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "dev": true }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "16.18.11", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.11.tgz", @@ -5754,9 +5763,10 @@ "dev": true }, "node_modules/@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "version": "8.5.14", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.14.tgz", + "integrity": "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw==", + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -8409,7 +8419,8 @@ "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" }, "node_modules/buffer-from": { "version": "1.1.2", @@ -9962,6 +9973,7 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" } @@ -13410,9 +13422,10 @@ } }, "node_modules/isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "license": "MIT", "peerDependencies": { "ws": "*" } @@ -13708,14 +13721,21 @@ ] }, "node_modules/jsonwebtoken": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.1.tgz", - "integrity": "sha512-K8wx7eJ5TPvEjuiVSkv167EVboBDv9PZdDoF7BgeQnBLVvZWW9clr2PsQHVJDTKaEIH5JBIwHujGcHp7GgI2eg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "license": "MIT", "dependencies": { "jws": "^3.2.2", - "lodash": "^4.17.21", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", "ms": "^2.1.1", - "semver": "^7.3.8" + "semver": "^7.5.4" }, "engines": { "node": ">=12", @@ -13726,6 +13746,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "license": "MIT", "dependencies": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -13736,6 +13757,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "license": "MIT", "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" @@ -14162,7 +14184,8 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "node_modules/lodash-es": { "version": "4.17.21", @@ -14193,17 +14216,39 @@ "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", "dev": true }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", - "dev": true + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" }, "node_modules/lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", - "dev": true + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" }, "node_modules/lodash.merge": { "version": "4.6.2", @@ -14211,6 +14256,12 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, "node_modules/lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", @@ -20375,7 +20426,8 @@ "node_modules/regenerator-runtime": { "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "dev": true }, "node_modules/regenerator-transform": { "version": "0.15.2", @@ -21997,22 +22049,22 @@ } }, "node_modules/stream-chat": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-8.44.0.tgz", - "integrity": "sha512-7HNtimD8sT/51rsFibGcD6uBgKj+vlKyYCZMDzjYQEaEsrLqyAg48dOyNM4L2FTF5aXgo9SlxZr21SPleeA2BA==", + "version": "9.0.0-rc.5", + "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.5.tgz", + "integrity": "sha512-ttcWjdwraOOTACBFILQKbmi3mj1AmAW7YIWtoNcsBNvpBoOx5wceeuq4HMhDmuOvNTvGXEOGJayyPBSw5Y9eSQ==", + "license": "SEE LICENSE IN LICENSE", "dependencies": { - "@babel/runtime": "^7.16.3", - "@types/jsonwebtoken": "~9.0.0", - "@types/ws": "^7.4.0", + "@types/jsonwebtoken": "^9.0.8", + "@types/ws": "^8.5.14", "axios": "^1.6.0", "base64-js": "^1.5.1", "form-data": "^4.0.0", - "isomorphic-ws": "^4.0.1", - "jsonwebtoken": "~9.0.0", - "ws": "^7.5.10" + "isomorphic-ws": "^5.0.0", + "jsonwebtoken": "^9.0.2", + "ws": "^8.18.1" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/stream-chat/node_modules/axios": { @@ -22039,15 +22091,16 @@ } }, "node_modules/stream-chat/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", + "license": "MIT", "engines": { - "node": ">=8.3.0" + "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -23667,15 +23720,6 @@ } } }, - "node_modules/webpack-dev-server/node_modules/@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/webpack-dev-server/node_modules/colorette": { "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", @@ -26285,6 +26329,7 @@ "version": "7.20.13", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz", "integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==", + "dev": true, "requires": { "regenerator-runtime": "^0.13.11" } @@ -27993,10 +28038,11 @@ "dev": true }, "@types/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.9.tgz", + "integrity": "sha512-uoe+GxEuHbvy12OUQct2X9JenKM3qAscquYymuQN4fMWG9DBQtykrQEFcAbVACF7qaLw9BePSodUL0kquqBJpQ==", "requires": { + "@types/ms": "*", "@types/node": "*" } }, @@ -28006,6 +28052,11 @@ "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "dev": true }, + "@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==" + }, "@types/node": { "version": "16.18.11", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.11.tgz", @@ -28108,9 +28159,9 @@ "dev": true }, "@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "version": "8.5.14", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.14.tgz", + "integrity": "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw==", "requires": { "@types/node": "*" } @@ -33580,9 +33631,9 @@ "dev": true }, "isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", "requires": {} }, "issue-parser": { @@ -33817,14 +33868,20 @@ "dev": true }, "jsonwebtoken": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.1.tgz", - "integrity": "sha512-K8wx7eJ5TPvEjuiVSkv167EVboBDv9PZdDoF7BgeQnBLVvZWW9clr2PsQHVJDTKaEIH5JBIwHujGcHp7GgI2eg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", "requires": { "jws": "^3.2.2", - "lodash": "^4.17.21", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", "ms": "^2.1.1", - "semver": "^7.3.8" + "semver": "^7.5.4" } }, "jwa": { @@ -34165,7 +34222,8 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "lodash-es": { "version": "4.17.21", @@ -34196,17 +34254,35 @@ "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", "dev": true }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", - "dev": true + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" }, "lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", - "dev": true + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" }, "lodash.merge": { "version": "4.6.2", @@ -34214,6 +34290,11 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", @@ -38613,7 +38694,8 @@ "regenerator-runtime": { "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "dev": true }, "regenerator-transform": { "version": "0.15.2", @@ -39808,19 +39890,18 @@ } }, "stream-chat": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-8.44.0.tgz", - "integrity": "sha512-7HNtimD8sT/51rsFibGcD6uBgKj+vlKyYCZMDzjYQEaEsrLqyAg48dOyNM4L2FTF5aXgo9SlxZr21SPleeA2BA==", + "version": "9.0.0-rc.5", + "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.5.tgz", + "integrity": "sha512-ttcWjdwraOOTACBFILQKbmi3mj1AmAW7YIWtoNcsBNvpBoOx5wceeuq4HMhDmuOvNTvGXEOGJayyPBSw5Y9eSQ==", "requires": { - "@babel/runtime": "^7.16.3", - "@types/jsonwebtoken": "~9.0.0", - "@types/ws": "^7.4.0", + "@types/jsonwebtoken": "^9.0.8", + "@types/ws": "^8.5.14", "axios": "^1.6.0", "base64-js": "^1.5.1", "form-data": "^4.0.0", - "isomorphic-ws": "^4.0.1", - "jsonwebtoken": "~9.0.0", - "ws": "^7.5.10" + "isomorphic-ws": "^5.0.0", + "jsonwebtoken": "^9.0.2", + "ws": "^8.18.1" }, "dependencies": { "axios": { @@ -39844,9 +39925,9 @@ } }, "ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", "requires": {} } } @@ -41044,15 +41125,6 @@ "ws": "^8.4.2" }, "dependencies": { - "@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "colorette": { "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", diff --git a/package.json b/package.json index a4dd5d60..49e496b9 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "pretty-bytes": "^6.1.1", "rxjs": "~7.4.0", "starwars-names": "^1.6.0", - "stream-chat": "^8.44.0", + "stream-chat": "9.0.0-rc.5", "ts-node": "^10.9.2", "tslib": "^2.3.0", "uuid": "^9.0.1", diff --git a/projects/customizations-example/src/app/message-action/message-action.component.ts b/projects/customizations-example/src/app/message-action/message-action.component.ts index 85a83da0..da3d7951 100644 --- a/projects/customizations-example/src/app/message-action/message-action.component.ts +++ b/projects/customizations-example/src/app/message-action/message-action.component.ts @@ -1,6 +1,5 @@ import { Component, Input } from '@angular/core'; import { - DefaultStreamChatGenerics, MessageActionHandlerExtraParams, StreamMessage, } from 'stream-chat-angular'; @@ -13,9 +12,9 @@ import { export class MessageActionComponent { @Input() actionName!: 'quote' | 'pin' | 'flag' | 'edit' | 'delete'; @Input() actionLabelOrTranslationKey!: - | ((m: StreamMessage) => string) + | ((m: StreamMessage) => string) | string; - @Input() message!: StreamMessage; + @Input() message!: StreamMessage; @Input() extraParams!: MessageActionHandlerExtraParams; @Input() actionHandler!: ( message: StreamMessage, @@ -36,9 +35,7 @@ export class MessageActionComponent { } getActionLabel( - actionLabelOrTranslationKey: - | ((m: StreamMessage) => string) - | string + actionLabelOrTranslationKey: ((m: StreamMessage) => string) | string ) { return typeof actionLabelOrTranslationKey === 'string' ? actionLabelOrTranslationKey diff --git a/projects/customizations-example/src/app/message-text/message-text.component.ts b/projects/customizations-example/src/app/message-text/message-text.component.ts index e2406fb0..9ff90810 100644 --- a/projects/customizations-example/src/app/message-text/message-text.component.ts +++ b/projects/customizations-example/src/app/message-text/message-text.component.ts @@ -1,6 +1,5 @@ import { Component, Input } from '@angular/core'; -import { MessageResponseBase } from 'stream-chat'; -import { DefaultStreamChatGenerics, StreamMessage } from 'stream-chat-angular'; +import { StreamMessage } from 'stream-chat-angular'; @Component({ selector: 'app-message-text', @@ -8,10 +7,7 @@ import { DefaultStreamChatGenerics, StreamMessage } from 'stream-chat-angular'; styleUrls: ['./message-text.component.scss'], }) export class MessageTextComponent { - @Input() message: - | StreamMessage - | undefined - | MessageResponseBase; + @Input() message: StreamMessage | undefined | StreamMessage['quoted_message']; @Input() isQuoted: boolean = false; @Input() shouldTranslate: boolean = false; isExpanded = false; diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index 3c3b353b..03b4f329 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -22,7 +22,7 @@ "@breezystack/lamejs": "^1.2.7", "@ngx-translate/core": "^14.0.0 || ^15.0.0", "rxjs": "^7.4.0", - "stream-chat": "^8.44.0" + "stream-chat": "9.0.0-rc.5" }, "peerDependenciesMeta": { "@breezystack/lamejs": { diff --git a/projects/stream-chat-angular/src/lib/attachment-configuration.service.ts b/projects/stream-chat-angular/src/lib/attachment-configuration.service.ts index 4496c552..b38cda14 100644 --- a/projects/stream-chat-angular/src/lib/attachment-configuration.service.ts +++ b/projects/stream-chat-angular/src/lib/attachment-configuration.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; import { Attachment } from 'stream-chat'; import { AttachmentConfigration, - DefaultStreamChatGenerics, ImageAttachmentConfiguration, VideoAttachmentConfiguration, } from './types'; @@ -13,14 +12,12 @@ import { @Injectable({ providedIn: 'root', }) -export class AttachmentConfigurationService< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> { +export class AttachmentConfigurationService { /** * A custom handler can be provided to override the default image attachment (images uploaded from files) configuration. By default the SDK uses fixed image height (a size that's known before image is loaded), if you override that with dynamic image height (for example: height: 100%) the scrolling logic inside the message list can break. */ customImageAttachmentConfigurationHandler?: ( - a: Attachment, + a: Attachment, type: 'gallery' | 'single' | 'carousel', containerElement: HTMLElement ) => ImageAttachmentConfiguration; @@ -28,20 +25,20 @@ export class AttachmentConfigurationService< * A custom handler can be provided to override the default video attachment (videos uploaded from files) configuration. By default the SDK uses fixed height (a size that's known before video is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break. */ customVideoAttachmentConfigurationHandler?: ( - a: Attachment, + a: Attachment, containerElement: HTMLElement ) => VideoAttachmentConfiguration; /** * A custom handler can be provided to override the default giphy attachment (GIFs sent with the /giphy command) configuration. By default the SDK uses fixed height (a size that's known before the GIF is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break. */ customGiphyAttachmentConfigurationHandler?: ( - a: Attachment + a: Attachment ) => AttachmentConfigration; /** * A custom handler can be provided to override the default scraped image attachment (images found in links inside messages) configuration. By default the SDK uses fixed height (a size that's known before image is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break. */ customScrapedImageAttachmentConfigurationHandler?: ( - a: Attachment + a: Attachment ) => AttachmentConfigration; /** * You can turn on/off thumbnail generation for video attachments @@ -55,7 +52,7 @@ export class AttachmentConfigurationService< * @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN. */ getImageAttachmentConfiguration( - attachment: Attachment, + attachment: Attachment, location: 'gallery' | 'single' | 'carousel', element: HTMLElement ): ImageAttachmentConfiguration { @@ -68,10 +65,8 @@ export class AttachmentConfigurationService< } const defaultOriginalDimension = 1000000; - const urlString = (attachment.img_url || - attachment.thumb_url || - attachment.image_url || - '') as string; + const urlString = + attachment.img_url || attachment.thumb_url || attachment.image_url || ''; let url: URL; try { url = new URL(urlString); @@ -121,7 +116,7 @@ export class AttachmentConfigurationService< * @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN. */ getVideoAttachmentConfiguration( - attachment: Attachment, + attachment: Attachment, element: HTMLElement ): VideoAttachmentConfiguration { if (this.customVideoAttachmentConfigurationHandler) { @@ -178,7 +173,7 @@ export class AttachmentConfigurationService< * @param attachment The attachment to configure */ getGiphyAttachmentConfiguration( - attachment: Attachment + attachment: Attachment ): AttachmentConfigration { if (this.customGiphyAttachmentConfigurationHandler) { return this.customGiphyAttachmentConfigurationHandler(attachment); @@ -198,7 +193,7 @@ export class AttachmentConfigurationService< * @param attachment The attachment to configure */ getScrapedImageAttachmentConfiguration( - attachment: Attachment + attachment: Attachment ): AttachmentConfigration { if (this.customScrapedImageAttachmentConfigurationHandler) { return this.customScrapedImageAttachmentConfigurationHandler(attachment); diff --git a/projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html b/projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html index cea45d63..ea0dd45a 100644 --- a/projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html +++ b/projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html @@ -21,7 +21,9 @@ isVoiceMessage(attachment) " [class.str-chat__message-attachment-with-actions]=" - attachment.actions && attachment.actions.length > 0 + !isGalleryType(attachment) && + attachment.actions && + attachment.actions.length > 0 " [class.str-chat__message-attachment--svg-image]="isSvg(attachment)" > @@ -406,7 +408,13 @@ - + { await init(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); const capabilites = activeChannel.data?.own_capabilities as string[]; capabilites.splice(capabilites.indexOf('read-events'), 1); @@ -648,7 +635,7 @@ describe('ChannelService', () => { const pinnedMessagesSpy = jasmine.createSpy(); service.activeChannelPinnedMessages$.subscribe(pinnedMessagesSpy); pinnedMessagesSpy.calls.reset(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); const pinnedMessages = generateMockMessages(); activeChannel.state.pinnedMessages = pinnedMessages; @@ -670,7 +657,7 @@ describe('ChannelService', () => { const spy = jasmine.createSpy(); service.activeChannelMessages$.subscribe(spy); spy.calls.reset(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); const message = activeChannel.state.messages[activeChannel.state.messages.length - 1]; @@ -694,7 +681,7 @@ describe('ChannelService', () => { it('should move channel to the top of the list', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.channels$ .pipe(first()) .subscribe((channels) => (channel = channels![1])); @@ -703,7 +690,7 @@ describe('ChannelService', () => { const event = { message: mockMessage(), type: 'message.new', - } as any as Event; + } as any as Event; (channel as MockChannel).handleEvent('message.new', event); const firtChannel = (spy.calls.mostRecent().args[0] as Channel[])[0]; @@ -713,7 +700,7 @@ describe('ChannelService', () => { it('should call custom #customNewMessageHandler, if handler is provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.channels$ .pipe(first()) .subscribe((channels) => (channel = channels![1])); @@ -722,7 +709,7 @@ describe('ChannelService', () => { const event = { message: mockMessage(), type: 'message.new', - } as any as Event; + } as any as Event; (channel as MockChannel).handleEvent('message.new', event); expect(spy).toHaveBeenCalledWith( @@ -737,7 +724,7 @@ describe('ChannelService', () => { it('should handle if channel visibility changes', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const spy = jasmine.createSpy(); service.channels$.subscribe(spy); @@ -765,7 +752,7 @@ describe('ChannelService', () => { it('should handle if channel visibility changes, if custom event handlers are provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const visibleSpy = jasmine.createSpy(); const hiddenSpy = jasmine.createSpy(); @@ -774,7 +761,7 @@ describe('ChannelService', () => { const hiddenEvent = { type: 'channel.hidden', channel, - } as any as Event; + } as any as Event; (channel as MockChannel).handleEvent('channel.hidden', hiddenEvent); expect(hiddenSpy).toHaveBeenCalledWith( @@ -789,7 +776,7 @@ describe('ChannelService', () => { const visibleEvent = { type: 'channel.visible', channel, - } as any as Event; + } as any as Event; (channel as MockChannel).handleEvent('channel.hidden', visibleEvent); expect(visibleSpy).toHaveBeenCalledWith( @@ -804,7 +791,7 @@ describe('ChannelService', () => { it('should remove channel from list, if deleted', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const spy = jasmine.createSpy(); service.channels$.subscribe(spy); @@ -823,14 +810,14 @@ describe('ChannelService', () => { it('should call #customChannelDeletedHandler, if channel is deleted and handler is provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const spy = jasmine.createSpy(); service.customChannelDeletedHandler = spy; const event = { type: 'channel.deleted', channel, - } as any as Event; + } as any as Event; (channel as MockChannel).handleEvent('channel.deleted', event); expect(spy).toHaveBeenCalledWith( @@ -845,7 +832,7 @@ describe('ChannelService', () => { it('should update channel in list, if updated', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const spy = jasmine.createSpy(); service.channels$.subscribe(spy); @@ -868,7 +855,7 @@ describe('ChannelService', () => { it('should emit changed channel if `capabilities.changed` dispatched', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const spy = jasmine.createSpy(); service.channels$.subscribe(spy); @@ -887,7 +874,7 @@ describe('ChannelService', () => { it('should call #customChannelUpdatedHandler, if updated and handler is provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const spy = jasmine.createSpy(); service.customChannelUpdatedHandler = spy; @@ -897,7 +884,7 @@ describe('ChannelService', () => { cid: channel.cid, name: 'New name', }, - } as Event; + } as Event; (channel as MockChannel).handleEvent('channel.updated', event); expect(spy).toHaveBeenCalledWith( @@ -912,7 +899,7 @@ describe('ChannelService', () => { it('should handle if channel is truncated', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const channelsSpy = jasmine.createSpy(); service.channels$.subscribe(channelsSpy); @@ -937,7 +924,7 @@ describe('ChannelService', () => { it('should call #customChannelTruncatedHandler, if channel is truncated and custom handler is provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const spy = jasmine.createSpy(); service.customChannelTruncatedHandler = spy; @@ -947,7 +934,7 @@ describe('ChannelService', () => { cid: channel.cid, name: 'New name', }, - } as Event; + } as Event; (channel as MockChannel).handleEvent('channel.truncated', event); expect(spy).toHaveBeenCalledWith( @@ -966,7 +953,7 @@ describe('ChannelService', () => { service.activeChannelMessages$.subscribe(spy); const message = (spy.calls.mostRecent().args[0] as StreamMessage[])[0]; spy.calls.reset(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); (activeChannel as MockChannel).handleEvent('reaction.new', { message }); @@ -1010,7 +997,7 @@ describe('ChannelService', () => { service.channels$.subscribe(spy); events$.next({ eventType: 'notification.added_to_channel', - event: { channel: newChannel } as any as Event, + event: { channel: newChannel } as any as Event, }); tick(); @@ -1035,7 +1022,7 @@ describe('ChannelService', () => { service.channels$.subscribe(spy); events$.next({ eventType: 'notification.message_new', - event: { channel: channel } as any as Event, + event: { channel: channel } as any as Event, }); tick(); flush(); @@ -1061,11 +1048,11 @@ describe('ChannelService', () => { service.channels$.subscribe(spy); events$.next({ eventType: 'notification.added_to_channel', - event: { channel: channel } as any as Event, + event: { channel: channel } as any as Event, }); events$.next({ eventType: 'notification.message_new', - event: { channel: channel } as any as Event, + event: { channel: channel } as any as Event, }); tick(); flush(); @@ -1078,7 +1065,7 @@ describe('ChannelService', () => { it('should remove channel form the list if user is removed from channel', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.channels$ .pipe(first()) .subscribe((channels) => (channel = channels![1])); @@ -1090,7 +1077,7 @@ describe('ChannelService', () => { events$.next({ eventType: 'notification.removed_from_channel', - event: { channel: channel } as any as Event, + event: { channel: channel } as any as Event, }); let channels = spy.calls.mostRecent().args[0] as Channel[]; @@ -1112,8 +1099,8 @@ describe('ChannelService', () => { it('should remove channel form the list if user is removed from channel, and emit new active channel', async () => { await init(); - let channel!: Channel; - let newActiveChannel!: Channel; + let channel!: Channel; + let newActiveChannel!: Channel; service.channels$.pipe(first()).subscribe((channels) => { channel = channels![0]; newActiveChannel = channels![1]; @@ -1123,7 +1110,7 @@ describe('ChannelService', () => { spyOn(service, 'setAsActiveChannel'); events$.next({ eventType: 'notification.removed_from_channel', - event: { channel: channel } as any as Event, + event: { channel: channel } as any as Event, }); const channels = spy.calls.mostRecent().args[0] as Channel[]; @@ -1136,13 +1123,13 @@ describe('ChannelService', () => { await init(); const spy = jasmine.createSpy(); service.customNewMessageNotificationHandler = spy; - let channel!: Channel; + let channel!: Channel; service.channels$ .pipe(first()) .subscribe((channels) => (channel = channels![1])); const event = { channel: channel, - } as any as Event; + } as any as Event; const channelsSpy = jasmine.createSpy(); service.channels$.subscribe(channelsSpy); channelsSpy.calls.reset(); @@ -1167,13 +1154,13 @@ describe('ChannelService', () => { setter([]) ); service.customAddedToChannelNotificationHandler = spy; - let channel!: Channel; + let channel!: Channel; service.channels$ .pipe(first()) .subscribe((channels) => (channel = channels![1])); const event = { channel: channel, - } as any as Event; + } as any as Event; const channelsSpy = jasmine.createSpy(); service.channels$.subscribe(channelsSpy); channelsSpy.calls.reset(); @@ -1194,13 +1181,13 @@ describe('ChannelService', () => { await init(); const spy = jasmine.createSpy(); service.customRemovedFromChannelNotificationHandler = spy; - let channel!: Channel; + let channel!: Channel; service.channels$ .pipe(first()) .subscribe((channels) => (channel = channels![1])); const event = { channel: channel, - } as any as Event; + } as any as Event; const channelsSpy = jasmine.createSpy(); service.channels$.subscribe(channelsSpy); channelsSpy.calls.reset(); @@ -1219,7 +1206,7 @@ describe('ChannelService', () => { it('should send message', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendMessage').and.callThrough(); spyOn(channel.state, 'addMessageSorted').and.callThrough(); @@ -1272,7 +1259,7 @@ describe('ChannelService', () => { it('should send message - #beforeSendMessage hook is provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendMessage').and.callThrough(); spyOn(channel.state, 'addMessageSorted').and.callThrough(); @@ -1282,6 +1269,7 @@ describe('ChannelService', () => { const spy = jasmine.createSpy(); service.beforeSendMessage = spy; spy.and.callFake((i: MessageInput) => { + // @ts-expect-error testing custom proerpty i.customData = { custom: 'red' }; return i; }); @@ -1294,6 +1282,7 @@ describe('ChannelService', () => { id: jasmine.any(String), parent_id: undefined, quoted_message_id: undefined, + // @ts-expect-error testing custom proerpty custom: 'red', }); @@ -1325,7 +1314,7 @@ describe('ChannelService', () => { it('should send action', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const giphy = { thumb_url: @@ -1339,7 +1328,7 @@ describe('ChannelService', () => { id: 'message-1', attachments: [giphy], }, - } as any as SendMessageAPIResponse); + } as any as SendMessageAPIResponse); let latestMessage!: StreamMessage; service.activeChannelMessages$.subscribe( (m) => (latestMessage = m[m.length - 1]) @@ -1351,10 +1340,10 @@ describe('ChannelService', () => { it('should remove message after action, if no message is returned', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendAction').and.resolveTo( - {} as any as SendMessageAPIResponse + {} as any as SendMessageAPIResponse ); spyOn(channel.state, 'removeMessage'); await service.sendAction('1', { image_action: 'send' }); @@ -1475,7 +1464,7 @@ describe('ChannelService', () => { latestMessage = m[m.length - 1]; }); latestMessage.status = 'failed'; - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendMessage').and.callThrough(); spyOn(channel.state, 'addMessageSorted').and.callThrough(); @@ -1512,7 +1501,7 @@ describe('ChannelService', () => { latestMessage = m[m.length - 1]; }); latestMessage.status = 'failed'; - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendMessage').and.rejectWith({ code: 4, @@ -1539,7 +1528,7 @@ describe('ChannelService', () => { it('should set message state while sending', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendMessage'); const text = 'Hi'; @@ -1554,7 +1543,7 @@ describe('ChannelService', () => { it('should set message state after message is sent', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendMessage'); const text = 'Hi'; @@ -1576,7 +1565,7 @@ describe('ChannelService', () => { // this could happen when a message was added to the local state while offline it('should handle message order change', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const localMessage = channel.state.messages.splice( channel.state.messages.length - 2, @@ -1594,7 +1583,7 @@ describe('ChannelService', () => { it('should set message state, if an error occured', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendMessage').and.callFake(() => Promise.reject({ status: 500 }) @@ -1612,12 +1601,12 @@ describe('ChannelService', () => { it('should add sent message to message list', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendMessage').and.callFake(() => Promise.resolve({ message: { id: 'new-message' }, - } as SendMessageAPIResponse) + } as SendMessageAPIResponse) ); let latestMessage!: StreamMessage; service.activeChannelMessages$.subscribe( @@ -1630,7 +1619,7 @@ describe('ChannelService', () => { it(`shouldn't duplicate new message`, async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); await service.sendMessage('Hi'); let newMessageId!: string; @@ -1648,7 +1637,7 @@ describe('ChannelService', () => { it('should upload attachments', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'sendImage').and.callFake((file: File) => { switch (file.name) { @@ -1771,7 +1760,7 @@ describe('ChannelService', () => { it('should delete image attachment', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'deleteImage'); const url = 'http://url/to/image'; @@ -1787,7 +1776,7 @@ describe('ChannelService', () => { it('should delete file attachment', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); spyOn(channel, 'deleteFile'); const url = 'http://url/to/file'; @@ -1803,7 +1792,7 @@ describe('ChannelService', () => { it('should update #readBy array, if active channel is read', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); let latestMessage!: StreamMessage; service.activeChannelMessages$.subscribe( @@ -1829,7 +1818,7 @@ describe('ChannelService', () => { await init(); const spy = jasmine.createSpy('activeMessagesSpy'); service.activeChannelMessages$.subscribe(spy); - let prevActiveChannel!: Channel; + let prevActiveChannel!: Channel; service.activeChannel$ .pipe(first()) .subscribe((c) => (prevActiveChannel = c!)); @@ -1854,10 +1843,7 @@ describe('ChannelService', () => { jack: { user: { id: 'jack', name: 'Jack' } }, john: { user: { id: 'john' } }, [user.id]: { user }, - } as any as Record< - string, - ChannelMemberResponse - >; + } as any as Record; service.setAsActiveChannel(channel); const result = await service.autocompleteMembers('ja'); const expectedResult = [ @@ -1876,14 +1862,11 @@ describe('ChannelService', () => { members: [ { user_id: mockCurrentUser().id }, { user_id: 'jack' }, - ] as unknown as ChannelMemberResponse[], + ] as unknown as ChannelMemberResponse[], duration: '0ms', }); const users = Array.from({ length: 101 }, (_, i) => ({ id: `${i}` })); - channel.state.members = {} as any as Record< - string, - ChannelMemberResponse - >; + channel.state.members = {} as any as Record; users.forEach((u) => (channel.state.members[u.id] = { user: u })); service.setAsActiveChannel(channel); const result = await service.autocompleteMembers('ja'); @@ -1918,7 +1901,7 @@ describe('ChannelService', () => { it('should notify channel if typing started', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.subscribe((c) => (channel = c!)); spyOn(channel, 'keystroke'); await service.typingStarted(); @@ -1928,7 +1911,7 @@ describe('ChannelService', () => { it('should notify channel if typing stopped', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.subscribe((c) => (channel = c!)); spyOn(channel, 'stopTyping'); await service.typingStopped(); @@ -1993,12 +1976,10 @@ describe('ChannelService', () => { it('should emit the date of latest messages sent by the user by channels', async () => { await init(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$ .pipe(first()) - .subscribe( - (c) => (activeChannel = c as Channel) - ); + .subscribe((c) => (activeChannel = c as Channel)); const newMessage = mockMessage(); newMessage.cid = 'channel1'; newMessage.created_at = new Date(); @@ -2014,7 +1995,7 @@ describe('ChannelService', () => { it('should call custom #customFileUploadRequest and #customImageUploadRequest if provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const customImageUploadRequest = jasmine .createSpy() @@ -2095,7 +2076,7 @@ describe('ChannelService', () => { it('should call custom #customImageDeleteRequest if provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const customImageDeleteRequest = jasmine.createSpy(); service.customImageDeleteRequest = customImageDeleteRequest; @@ -2114,7 +2095,7 @@ describe('ChannelService', () => { it('should call custom #customFileDeleteRequest if provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const customFileDeleteRequest = jasmine.createSpy(); service.customFileDeleteRequest = customFileDeleteRequest; @@ -2204,7 +2185,7 @@ describe('ChannelService', () => { const messagesSpy = jasmine.createSpy(); service.activeChannelMessages$.subscribe(messagesSpy); messagesSpy.calls.reset(); - let activeChannel: Channel; + let activeChannel: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); const error = new Error(); spyOn(activeChannel!.state, 'loadMessageIntoState').and.rejectWith(error); @@ -2270,9 +2251,9 @@ describe('ChannelService', () => { it('should relaod active channel if active channel is not present after state reconnect', fakeAsync(async () => { await init(); flush(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); - let channels!: Channel[]; + let channels!: Channel[]; service.channels$.subscribe((c) => (channels = c!)); channels = channels.filter((c) => c.id !== activeChannel.id); spyOn(activeChannel, 'watch'); @@ -2289,7 +2270,7 @@ describe('ChannelService', () => { it(`shouldn't deselect active channel if active channel is present after state reconnect`, fakeAsync(async () => { await init(); - let channels!: Channel[]; + let channels!: Channel[]; service.channels$.subscribe((c) => (channels = c!)); const activeChannel = channels[0]; const spy = jasmine.createSpy(); @@ -2375,7 +2356,7 @@ describe('ChannelService', () => { activeChannel.state.latestMessages = [ { id: 'last-read-message-id', - } as any as FormatMessageResponse, + } as any as FormatMessageResponse, ]; service.setAsActiveChannel(activeChannel); @@ -2404,15 +2385,14 @@ describe('ChannelService', () => { await init(); const spy = jasmine.createSpy(); service.activeChannel$.subscribe(spy); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.pipe(take(1)).subscribe((c) => (activeChannel = c!)); activeChannel.state.members['jack'].user!.name = 'John'; mockChatClient.activeChannels[activeChannel.cid] = activeChannel; spy.calls.reset(); events$.next({ eventType: 'user.updated' } as ClientEvent); - const updatedChannel = spy.calls.mostRecent() - .args[0] as Channel; + const updatedChannel = spy.calls.mostRecent().args[0] as Channel; expect(updatedChannel.state.members['jack'].user!.name).toBe('John'); }); @@ -2571,7 +2551,7 @@ describe('ChannelService', () => { channel_id: service.activeChannel?.id, unread_messages: 12, last_read_message_id: 'last-read-message', - } as Event, + } as Event, }); expect(service.activeChannelLastReadMessageId).toBe('last-read-message'); @@ -2583,7 +2563,7 @@ describe('ChannelService', () => { channel_id: 'not-active-channel', unread_messages: 20, last_read_message_id: 'different id', - } as Event, + } as Event, }); expect(service.activeChannelLastReadMessageId).toBe('last-read-message'); diff --git a/projects/stream-chat-angular/src/lib/channel.service.thread.spec.ts b/projects/stream-chat-angular/src/lib/channel.service.thread.spec.ts index 58edd9ff..4d50886c 100644 --- a/projects/stream-chat-angular/src/lib/channel.service.thread.spec.ts +++ b/projects/stream-chat-angular/src/lib/channel.service.thread.spec.ts @@ -19,7 +19,7 @@ import { mockMessage, } from './mocks'; import { NotificationService } from './notification.service'; -import { DefaultStreamChatGenerics, StreamMessage } from './types'; +import { StreamMessage } from './types'; describe('ChannelService - threads', () => { let service: ChannelService; @@ -33,11 +33,11 @@ describe('ChannelService - threads', () => { let events$: Subject; let connectionState$: Subject<'online' | 'offline'>; let init: ( - c?: Channel[], - sort?: ChannelSort, + c?: Channel[], + sort?: ChannelSort, options?: ChannelOptions ) => Promise; - let user: UserResponse; + let user: UserResponse; const filters = { type: 'messaging' }; beforeEach(() => { @@ -68,8 +68,8 @@ describe('ChannelService - threads', () => { }); service = TestBed.inject(ChannelService); init = async ( - channels?: Channel[], - sort?: ChannelSort, + channels?: Channel[], + sort?: ChannelSort, options?: ChannelOptions ) => { mockChatClient.queryChannels.and.returnValue( @@ -111,14 +111,14 @@ describe('ChannelService - threads', () => { messagesSpy.calls.reset(); activeParentMessageIdSpy.calls.reset(); activeParentMessageSpy.calls.reset(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.subscribe((c) => (channel = c!)); let parentMessage!: StreamMessage; service.activeChannelMessages$.subscribe((m) => (parentMessage = m[0])); const replies = [mockMessage(), mockMessage(), mockMessage()]; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); expect(messagesSpy).toHaveBeenCalledWith(replies); @@ -246,12 +246,12 @@ describe('ChannelService - threads', () => { service.activeThreadMessages$.subscribe(messagesSpy); messagesSpy.calls.reset(); const message = mockMessage(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.subscribe((c) => (channel = c!)); const replies = [mockMessage(), mockMessage(), mockMessage()]; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(message); let threadMessages!: StreamMessage[]; service.activeThreadMessages$.subscribe((m) => (threadMessages = m)); @@ -266,12 +266,12 @@ describe('ChannelService - threads', () => { service.activeThreadMessages$.subscribe(messagesSpy); messagesSpy.calls.reset(); const parentMessage = mockMessage(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.subscribe((c) => (channel = c!)); const replies = [mockMessage(), mockMessage(), mockMessage()]; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); replies[0].id = 'firstreply'; await service.setAsActiveParentMessage(parentMessage); let threadMessages!: StreamMessage[]; @@ -296,12 +296,12 @@ describe('ChannelService - threads', () => { service.activeThreadMessages$.subscribe(messagesSpy); messagesSpy.calls.reset(); const parentMessage = mockMessage(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.subscribe((c) => (channel = c!)); const replies = [mockMessage(), mockMessage(), mockMessage()]; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); replies[0].id = 'firstreply'; await service.setAsActiveParentMessage(parentMessage); (channel.getReplies as jasmine.Spy).calls.reset(); @@ -325,7 +325,7 @@ describe('ChannelService - threads', () => { service.activeThreadMessages$.subscribe(spy); const prevCount = (spy.calls.mostRecent().args[0] as Channel[]).length; spy.calls.reset(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); const newMessage = mockMessage(); newMessage.parent_id = parentMessage.id; @@ -347,7 +347,7 @@ describe('ChannelService - threads', () => { await service.setAsActiveParentMessage(parentMessage); service.activeThreadMessages$.subscribe(spy); spy.calls.reset(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); const newMessage = mockMessage(); newMessage.parent_id = 'not' + parentMessage.id; @@ -365,13 +365,13 @@ describe('ChannelService - threads', () => { it('should watch for message update events', async () => { await init(); const parentMessage = mockMessage(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); const messageToUpdate = mockMessage(); messageToUpdate.parent_id = parentMessage.id; spyOn(activeChannel, 'getReplies').and.resolveTo({ messages: [messageToUpdate], - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); messageToUpdate.text = 'updated'; activeChannel.state.threads = { [parentMessage.id]: [messageToUpdate] }; @@ -389,13 +389,13 @@ describe('ChannelService - threads', () => { it('should watch for message deleted events', async () => { await init(); const parentMessage = mockMessage(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); const messageToDelete = mockMessage(); messageToDelete.parent_id = parentMessage.id; spyOn(activeChannel, 'getReplies').and.resolveTo({ messages: [messageToDelete], - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); messageToDelete.deleted_at = new Date(); activeChannel.state.threads = { [parentMessage.id]: [messageToDelete] }; @@ -412,7 +412,7 @@ describe('ChannelService - threads', () => { it('should handle if channel is truncated', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const messagesSpy = jasmine.createSpy(); service.activeThreadMessages$.subscribe(messagesSpy); @@ -433,7 +433,7 @@ describe('ChannelService - threads', () => { it('should call #customChannelTruncatedHandler, if channel is truncated and custom handler is provided', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const spy = jasmine .createSpy() @@ -457,7 +457,7 @@ describe('ChannelService - threads', () => { cid: channel.cid, name: 'New name', }, - } as any as Event; + } as any as Event; const messagesSpy = jasmine.createSpy(); service.activeThreadMessages$.subscribe(messagesSpy); const parentMessageSpy = jasmine.createSpy(); @@ -484,14 +484,14 @@ describe('ChannelService - threads', () => { const spy = jasmine.createSpy(); service.activeThreadMessages$.subscribe(spy); spy.calls.reset(); - let activeChannel!: Channel; + let activeChannel!: Channel; service.activeChannel$.subscribe((c) => (activeChannel = c!)); const parentMessage = mockMessage(); const replies = [mockMessage(), mockMessage()]; replies.forEach((r) => (r.parent_id = parentMessage.id)); spyOn(activeChannel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); const message = replies[1]; (activeChannel as MockChannel).handleEvent('reaction.new', { message }); @@ -511,7 +511,7 @@ describe('ChannelService - threads', () => { it('should send message', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const parentMessage = mockMessage(); parentMessage.id = 'parentId'; @@ -520,7 +520,7 @@ describe('ChannelService - threads', () => { channel.state.threads[parentMessage.id] = replies; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); spyOn(channel, 'sendMessage').and.callThrough(); spyOn(channel.state, 'addMessageSorted').and.callThrough(); @@ -571,7 +571,7 @@ describe('ChannelService - threads', () => { it('should send action', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const parentMessage = mockMessage(); parentMessage.id = 'parentId'; @@ -580,7 +580,7 @@ describe('ChannelService - threads', () => { channel.state.threads[parentMessage.id] = replies; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); const giphy = { thumb_url: @@ -595,7 +595,7 @@ describe('ChannelService - threads', () => { attachments: [giphy], parent_id: parentMessage.id, }, - } as any as SendMessageAPIResponse); + } as any as SendMessageAPIResponse); let message!: StreamMessage; service.activeThreadMessages$.subscribe((m) => (message = m[m.length - 1])); await service.sendAction(replies[replies.length - 1].id, { @@ -607,7 +607,7 @@ describe('ChannelService - threads', () => { it('should remove message after action, if no message is returned', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const parentMessage = mockMessage(); parentMessage.id = 'parentId'; @@ -616,10 +616,10 @@ describe('ChannelService - threads', () => { channel.state.threads[parentMessage.id] = replies; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); spyOn(channel, 'sendAction').and.resolveTo( - {} as any as SendMessageAPIResponse + {} as any as SendMessageAPIResponse ); spyOn(channel.state, 'removeMessage'); await service.sendAction( @@ -638,7 +638,7 @@ describe('ChannelService - threads', () => { it('should set message state after message is sent', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const parentMessage = mockMessage(); parentMessage.id = 'parentId'; @@ -647,7 +647,7 @@ describe('ChannelService - threads', () => { channel.state.threads[parentMessage.id] = replies; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); const text = 'Hi'; spyOn(channel, 'sendMessage').and.resolveTo({ @@ -656,7 +656,7 @@ describe('ChannelService - threads', () => { parent_id: parentMessage.id, text, }, - } as SendMessageAPIResponse); + } as SendMessageAPIResponse); let latestMessage!: StreamMessage; service.activeThreadMessages$.subscribe( (m) => (latestMessage = m[m.length - 1]) @@ -668,7 +668,7 @@ describe('ChannelService - threads', () => { it('should set message state, if an error occured', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const parentMessage = mockMessage(); parentMessage.id = 'parentId'; @@ -677,7 +677,7 @@ describe('ChannelService - threads', () => { channel.state.threads[parentMessage.id] = replies; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); const text = 'Hi'; spyOn(channel, 'sendMessage').and.rejectWith({ status: 500 }); @@ -693,7 +693,7 @@ describe('ChannelService - threads', () => { it('should add sent message to message list', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.pipe(first()).subscribe((c) => (channel = c!)); const parentMessage = mockMessage(); parentMessage.id = 'parentId'; @@ -702,7 +702,7 @@ describe('ChannelService - threads', () => { channel.state.threads[parentMessage.id] = replies; spyOn(channel, 'getReplies').and.resolveTo({ messages: replies, - } as any as GetRepliesAPIResponse); + } as any as GetRepliesAPIResponse); await service.setAsActiveParentMessage(parentMessage); const text = 'Hi'; spyOn(channel, 'sendMessage').and.resolveTo({ @@ -711,7 +711,7 @@ describe('ChannelService - threads', () => { parent_id: parentMessage.id, text, }, - } as SendMessageAPIResponse); + } as SendMessageAPIResponse); let latestMessage!: StreamMessage; service.activeThreadMessages$.subscribe( (m) => (latestMessage = m[m.length - 1]) @@ -723,7 +723,7 @@ describe('ChannelService - threads', () => { it('should notify channel if typing started', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.subscribe((c) => (channel = c!)); spyOn(channel, 'keystroke'); await service.typingStarted('parentId'); @@ -733,7 +733,7 @@ describe('ChannelService - threads', () => { it('should notify channel if typing stopped', async () => { await init(); - let channel!: Channel; + let channel!: Channel; service.activeChannel$.subscribe((c) => (channel = c!)); spyOn(channel, 'stopTyping'); await service.typingStopped('parentId'); diff --git a/projects/stream-chat-angular/src/lib/channel.service.ts b/projects/stream-chat-angular/src/lib/channel.service.ts index 50631233..d1f72cd7 100644 --- a/projects/stream-chat-angular/src/lib/channel.service.ts +++ b/projects/stream-chat-angular/src/lib/channel.service.ts @@ -14,6 +14,8 @@ import { ChannelOptions, ChannelResponse, ChannelSort, + CustomMessageData, + CustomReactionData, Event, EventTypes, FormatMessageResponse, @@ -35,7 +37,6 @@ import { ChannelQueryResult, ChannelQueryState, ChannelQueryType, - DefaultStreamChatGenerics, MessageInput, MessageReactionType, NextPageConfiguration, @@ -49,9 +50,7 @@ import { ChannelQuery } from './channel-query'; @Injectable({ providedIn: 'root', }) -export class ChannelService< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> { +export class ChannelService { /** * Emits `false` if there are no more pages of channels that can be loaded. */ @@ -63,7 +62,7 @@ export class ChannelService< * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail. * ::: */ - channels$: Observable[] | undefined>; + channels$: Observable; /** * The result of the latest channel query request. */ @@ -77,15 +76,15 @@ export class ChannelService< * * The active channel will always be marked as read when a new message is received */ - activeChannel$: Observable | undefined>; + activeChannel$: Observable; /** * Emits the list of currently loaded messages of the active channel. */ - activeChannelMessages$: Observable[]>; + activeChannelMessages$: Observable; /** * Emits the list of pinned messages of the active channel. */ - activeChannelPinnedMessages$: Observable[]>; + activeChannelPinnedMessages$: Observable; /** * Emits the id of the currently selected parent message. If no message is selected, it emits undefined. */ @@ -93,15 +92,15 @@ export class ChannelService< /** * Emits the list of currently loaded thread replies belonging to the selected parent message. If there is no currently active thread it emits an empty array. */ - activeThreadMessages$: Observable[]>; + activeThreadMessages$: Observable; /** * Emits the currently selected parent message. If no message is selected, it emits undefined. */ - activeParentMessage$: Observable | undefined>; + activeParentMessage$: Observable; /** * Emits the currently selected message to quote */ - messageToQuote$: Observable | undefined>; + messageToQuote$: Observable; /** * Emits the ID of the message the message list should jump to (can be a channel message or thread message) */ @@ -109,11 +108,11 @@ export class ChannelService< /** * Emits the list of users that are currently typing in the channel (current user is not included) */ - usersTypingInChannel$: Observable[]>; + usersTypingInChannel$: Observable; /** * Emits the list of users that are currently typing in the active thread (current user is not included) */ - usersTypingInThread$: Observable[]>; + usersTypingInThread$: Observable; /** * Emits a map that contains the date of the latest message sent by the current user by channels (this is used to detect if slow mode countdown should be started) */ @@ -123,7 +122,7 @@ export class ChannelService< * * If a message is bounced, it will be emitted via this `Observable`. The built-in [`MessageBouncePrompt` component](/chat/docs/sdk/angular/components/MessageBouncePromptComponent/) will display the bounce option to the user if a bounced message is clicked. */ - bouncedMessage$: BehaviorSubject | undefined>; + bouncedMessage$: BehaviorSubject; /** * The last read message id of the active channel, it's used by the message list component to display unread UI, and jump to latest read message * @@ -144,7 +143,7 @@ export class ChannelService< customNewMessageNotificationHandler?: ( clientEvent: ClientEvent, channelListSetter: ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels?: boolean ) => void ) => void; @@ -156,7 +155,7 @@ export class ChannelService< customAddedToChannelNotificationHandler?: ( clientEvent: ClientEvent, channelListSetter: ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels?: boolean ) => void ) => void; @@ -168,7 +167,7 @@ export class ChannelService< customRemovedFromChannelNotificationHandler?: ( clientEvent: ClientEvent, channelListSetter: ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels?: boolean ) => void ) => void; @@ -179,14 +178,14 @@ export class ChannelService< */ customChannelDeletedHandler?: ( event: Event, - channel: Channel, + channel: Channel, channelListSetter: ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels?: boolean ) => void, - messageListSetter: (messages: StreamMessage[]) => void, - threadListSetter: (messages: StreamMessage[]) => void, - parentMessageSetter: (message: StreamMessage | undefined) => void + messageListSetter: (messages: StreamMessage[]) => void, + threadListSetter: (messages: StreamMessage[]) => void, + parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** * Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). @@ -195,9 +194,9 @@ export class ChannelService< */ customChannelUpdatedHandler?: ( event: Event, - channel: Channel, + channel: Channel, channelListSetter: ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels?: boolean ) => void, messageListSetter: (messages: StreamMessage[]) => void, @@ -211,14 +210,14 @@ export class ChannelService< */ customChannelTruncatedHandler?: ( event: Event, - channel: Channel, + channel: Channel, channelListSetter: ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels?: boolean ) => void, - messageListSetter: (messages: StreamMessage[]) => void, - threadListSetter: (messages: StreamMessage[]) => void, - parentMessageSetter: (message: StreamMessage | undefined) => void + messageListSetter: (messages: StreamMessage[]) => void, + threadListSetter: (messages: StreamMessage[]) => void, + parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** * Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). @@ -227,14 +226,14 @@ export class ChannelService< */ customChannelHiddenHandler?: ( event: Event, - channel: Channel, + channel: Channel, channelListSetter: ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels?: boolean ) => void, - messageListSetter: (messages: StreamMessage[]) => void, - threadListSetter: (messages: StreamMessage[]) => void, - parentMessageSetter: (message: StreamMessage | undefined) => void + messageListSetter: (messages: StreamMessage[]) => void, + threadListSetter: (messages: StreamMessage[]) => void, + parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** * Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). @@ -243,14 +242,14 @@ export class ChannelService< */ customChannelVisibleHandler?: ( event: Event, - channel: Channel, + channel: Channel, channelListSetter: ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels?: boolean ) => void, - messageListSetter: (messages: StreamMessage[]) => void, - threadListSetter: (messages: StreamMessage[]) => void, - parentMessageSetter: (message: StreamMessage | undefined) => void + messageListSetter: (messages: StreamMessage[]) => void, + threadListSetter: (messages: StreamMessage[]) => void, + parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** * Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). @@ -259,58 +258,55 @@ export class ChannelService< */ customNewMessageHandler?: ( event: Event, - channel: Channel, + channel: Channel, channelListSetter: ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels?: boolean ) => void, - messageListSetter: (messages: StreamMessage[]) => void, - threadListSetter: (messages: StreamMessage[]) => void, - parentMessageSetter: (message: StreamMessage | undefined) => void + messageListSetter: (messages: StreamMessage[]) => void, + threadListSetter: (messages: StreamMessage[]) => void, + parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** * You can override the default file upload request - you can use this to upload files to your own CDN */ customFileUploadRequest?: ( file: File, - channel: Channel + channel: Channel ) => Promise<{ file: string }>; /** * You can override the default image upload request - you can use this to upload images to your own CDN */ customImageUploadRequest?: ( file: File, - channel: Channel + channel: Channel ) => Promise<{ file: string }>; /** * You can override the default file delete request - override this if you use your own CDN */ - customFileDeleteRequest?: (url: string, channel: Channel) => Promise; + customFileDeleteRequest?: (url: string, channel: Channel) => Promise; /** * You can override the default image delete request - override this if you use your own CDN */ - customImageDeleteRequest?: ( - url: string, - channel: Channel - ) => Promise; + customImageDeleteRequest?: (url: string, channel: Channel) => Promise; /** * The provided method will be called before deleting a message. If the returned Promise resolves to `true` to deletion will go ahead. If `false` is returned, the message won't be deleted. */ messageDeleteConfirmationHandler?: ( - message: StreamMessage + message: StreamMessage ) => Promise; /** * The provided method will be called before a new message is sent to Stream's API. You can use this hook to tranfrom or enrich the message being sent. */ beforeSendMessage?: ( - input: MessageInput - ) => MessageInput | Promise>; + input: MessageInput + ) => MessageInput | Promise; /** * The provided method will be called before a message is sent to Stream's API for update. You can use this hook to tranfrom or enrich the message being updated. */ beforeUpdateMessage?: ( - message: StreamMessage - ) => StreamMessage | Promise>; + message: StreamMessage + ) => StreamMessage | Promise; /** * @internal */ @@ -320,14 +316,14 @@ export class ChannelService< */ isMessageLoadingInProgress = false; messagePageSize = 25; - private channelsSubject = new BehaviorSubject[] | undefined>( + private channelsSubject = new BehaviorSubject( undefined ); - private activeChannelSubject = new BehaviorSubject | undefined>( + private activeChannelSubject = new BehaviorSubject( undefined ); private activeChannelMessagesSubject = new BehaviorSubject< - (StreamMessage | MessageResponse | FormatMessageResponse)[] + (StreamMessage | MessageResponse | FormatMessageResponse)[] >([]); private activeChannelPinnedMessagesSubject = new BehaviorSubject< StreamMessage[] @@ -339,7 +335,7 @@ export class ChannelService< string | undefined >(undefined); private activeThreadMessagesSubject = new BehaviorSubject< - (StreamMessage | MessageResponse | FormatMessageResponse)[] + (StreamMessage | MessageResponse | FormatMessageResponse)[] >([]); private jumpToMessageSubject = new BehaviorSubject<{ id?: string; @@ -350,14 +346,10 @@ export class ChannelService< }>({}); private readonly attachmentMaxSizeFallbackInMB = 100; private messageToQuoteSubject = new BehaviorSubject< - StreamMessage | undefined + StreamMessage | undefined >(undefined); - private usersTypingInChannelSubject = new BehaviorSubject[]>( - [] - ); - private usersTypingInThreadSubject = new BehaviorSubject[]>( - [] - ); + private usersTypingInChannelSubject = new BehaviorSubject([]); + private usersTypingInThreadSubject = new BehaviorSubject([]); private _shouldMarkActiveChannelAsRead = true; private shouldSetActiveChannel: boolean | undefined; private clientEventsSubscription: Subscription | undefined; @@ -366,14 +358,14 @@ export class ChannelService< ChannelQueryState | undefined >(undefined); private channelQuery?: - | ChannelQuery - | ((queryType: ChannelQueryType) => Promise>); + | ChannelQuery + | ((queryType: ChannelQueryType) => Promise); private _customPaginator: - | ((channelQueryResult: Channel[]) => NextPageConfiguration) + | ((channelQueryResult: Channel[]) => NextPageConfiguration) | undefined; private channelListSetter = ( - channels: Channel[], + channels: Channel[], shouldStopWatchingRemovedChannels = true ) => { const currentChannels = this.channelsSubject.getValue() || []; @@ -419,15 +411,15 @@ export class ChannelService< } }; - private messageListSetter = (messages: StreamMessage[]) => { + private messageListSetter = (messages: StreamMessage[]) => { this.activeChannelMessagesSubject.next(messages); }; - private threadListSetter = (messages: StreamMessage[]) => { + private threadListSetter = (messages: StreamMessage[]) => { this.activeThreadMessagesSubject.next(messages); }; - private parentMessageSetter = (message: StreamMessage | undefined) => { + private parentMessageSetter = (message: StreamMessage | undefined) => { this.activeParentMessageIdSubject.next(message?.id); }; private dismissErrorNotification?: () => void; @@ -437,7 +429,7 @@ export class ChannelService< private scheduledMarkReadRequest?: () => void; constructor( - private chatClientService: ChatClientService, + private chatClientService: ChatClientService, private ngZone: NgZone, private notificationService: NotificationService ) { @@ -454,7 +446,7 @@ export class ChannelService< }), shareReplay(1) ); - this.bouncedMessage$ = new BehaviorSubject | undefined>( + this.bouncedMessage$ = new BehaviorSubject( undefined ); this.hasMoreChannels$ = this.hasMoreChannelsSubject @@ -550,7 +542,7 @@ export class ChannelService< */ set customPaginator( paginator: - | ((channelQueryResult: Channel[]) => NextPageConfiguration) + | ((channelQueryResult: Channel[]) => NextPageConfiguration) | undefined ) { this._customPaginator = paginator; @@ -564,7 +556,7 @@ export class ChannelService< * If the channel wasn't previously part of the channel, it will be added to the beginning of the list. * @param channel */ - setAsActiveChannel(channel: Channel) { + setAsActiveChannel(channel: Channel) { const prevActiveChannel = this.activeChannelSubject.getValue(); if (prevActiveChannel?.cid === channel.cid) { return; @@ -627,7 +619,7 @@ export class ChannelService< * @param loadMessagesForm */ async setAsActiveParentMessage( - message: StreamMessage | undefined, + message: StreamMessage | undefined, loadMessagesForm: 'request' | 'state' = 'request' ) { const messageToQuote = this.messageToQuoteSubject.getValue(); @@ -734,8 +726,8 @@ export class ChannelService< * @returns the list of channels found by the query */ init( - filters: ChannelFilters, - sort?: ChannelSort, + filters: ChannelFilters, + sort?: ChannelSort, options?: ChannelOptions, shouldSetActiveChannel: boolean = true ) { @@ -770,7 +762,7 @@ export class ChannelService< * @returns the channels that were loaded */ initWithCustomQuery( - query: (queryType: ChannelQueryType) => Promise>, + query: (queryType: ChannelQueryType) => Promise, options: { shouldSetActiveChannel: boolean; messagePageSize: number } = { shouldSetActiveChannel: true, messagePageSize: this.messagePageSize, @@ -812,7 +804,7 @@ export class ChannelService< async addReaction( messageId: string, reactionType: MessageReactionType, - customData?: T['reactionType'] + customData?: CustomReactionData ) { await this.activeChannelSubject.getValue()?.sendReaction(messageId, { type: reactionType, @@ -842,13 +834,13 @@ export class ChannelService< */ async sendMessage( text: string, - attachments: Attachment[] = [], - mentionedUsers: UserResponse[] = [], + attachments: Attachment[] = [], + mentionedUsers: UserResponse[] = [], parentId: string | undefined = undefined, quotedMessageId: string | undefined = undefined, - customData: undefined | Partial = undefined + customData: undefined | CustomMessageData = undefined ) { - let input: MessageInput = { + let input: MessageInput = { text, attachments, mentionedUsers, @@ -869,7 +861,6 @@ export class ChannelService< input.customData ); const channel = this.activeChannelSubject.getValue()!; - preview.readBy = []; channel.state.addMessageSorted(preview, true); const response = await this.sendMessageRequest(preview, input.customData); return response; @@ -883,7 +874,8 @@ export class ChannelService< const channel = this.activeChannelSubject.getValue()!; channel.state.addMessageSorted( { - ...(message as unknown as MessageResponse), + ...(message as unknown as MessageResponse), + // @ts-expect-error stream-chat doesn't know about this property errorStatusCode: undefined, status: 'sending', }, @@ -896,24 +888,34 @@ export class ChannelService< * Updates the message in the active channel * @param message Mesage to be updated */ - async updateMessage(message: StreamMessage) { - let messageToUpdate = { + async updateMessage(message: StreamMessage) { + let messageToUpdate: StreamMessage = { ...message, }; + if (messageToUpdate.quoted_message) { + messageToUpdate.quoted_message = { + ...messageToUpdate.quoted_message, + }; + } delete messageToUpdate.i18n; if (this.beforeUpdateMessage) { - messageToUpdate = await this.beforeUpdateMessage( - messageToUpdate as StreamMessage - ); + messageToUpdate = await this.beforeUpdateMessage(messageToUpdate); } if (messageToUpdate.readBy) { - delete (messageToUpdate as Omit, 'readBy'>).readBy; + // @ts-expect-error this is only a run time proparty for the SDK + delete messageToUpdate.readBy; + } + if (messageToUpdate.translation) { + delete messageToUpdate.translation; + } + if (messageToUpdate.quoted_message?.translation) { + delete messageToUpdate.quoted_message.translation; } if (message.moderation_details) { return this.resendMessage(message); } const response = await this.chatClientService.chatClient.updateMessage( - messageToUpdate as unknown as UpdatedMessage + messageToUpdate as unknown as UpdatedMessage ); const channel = this.channelsSubject @@ -1081,7 +1083,7 @@ export class ChannelService< } const result = await activeChannel.queryMembers({ name: { $autocomplete: searchTerm }, - } as MemberFilters); // TODO: find out why we need typecast here + } as MemberFilters); // TODO: find out why we need typecast here return result.members.filter( (m) => m.user_id !== this.chatClientService.chatClient?.user?.id @@ -1141,7 +1143,7 @@ export class ChannelService< * The channel will be added to the beginning of the channel list * @param channel */ - addChannel(channel: Channel) { + addChannel(channel: Channel) { if (!this.channels.find((c) => c.cid === channel.cid)) { this.channelsSubject.next([channel, ...this.channels]); this.watchForChannelEvents(channel); @@ -1185,8 +1187,8 @@ export class ChannelService< } private async sendMessageRequest( - preview: MessageResponse | StreamMessage, - customData?: Partial, + preview: MessageResponse | StreamMessage, + customData?: CustomMessageData, isResend = false ) { const channel = this.activeChannelSubject.getValue()!; @@ -1205,7 +1207,7 @@ export class ChannelService< parent_id: preview.parent_id, quoted_message_id: preview.quoted_message_id, ...customData, - } as Message); // TODO: find out why we need typecast here + } as Message); // TODO: find out why we need typecast here channel.state.addMessageSorted( { ...response.message, @@ -1218,7 +1220,7 @@ export class ChannelService< ...channel.state.threads[preview.parent_id!], ]) : this.activeChannelMessagesSubject.next([...channel.state.messages]); - let messages!: StreamMessage[]; + let messages!: StreamMessage[]; (isThreadReply ? this.activeThreadMessages$ : this.activeChannelMessages$) .pipe(take(1)) .subscribe((m) => (messages = m)); @@ -1246,7 +1248,8 @@ export class ChannelService< channel.state.addMessageSorted( { - ...(preview as MessageResponse), + ...(preview as MessageResponse), + // @ts-expect-error stream-chat doesn't know about this property errorStatusCode: isAlreadyExists ? undefined : parsedError.status || undefined, @@ -1259,7 +1262,7 @@ export class ChannelService< ...channel.state.threads[preview.parent_id!], ]) : this.activeChannelMessagesSubject.next([...channel.state.messages]); - let messages!: StreamMessage[]; + let messages!: StreamMessage[]; (isThreadReply ? this.activeThreadMessages$ : this.activeChannelMessages$) .pipe(take(1)) .subscribe((m) => (messages = m)); @@ -1285,7 +1288,10 @@ export class ChannelService< this.activeChannelMessagesSubject.next([...messages]); if (parentMessageId) { const parentMessage = messages.find((m) => m.id === parentMessageId); - void this.setAsActiveParentMessage(parentMessage, 'state'); + void this.setAsActiveParentMessage( + parentMessage as StreamMessage, + 'state' + ); } this.jumpToMessageSubject.next({ id: messageId, @@ -1312,7 +1318,7 @@ export class ChannelService< * Pins the given message in the channel * @param message */ - async pinMessage(message: StreamMessage) { + async pinMessage(message: StreamMessage) { try { await this.chatClientService.chatClient?.pinMessage(message); this.notificationService.addTemporaryNotification( @@ -1331,7 +1337,7 @@ export class ChannelService< * Removes the given message from pinned messages * @param message */ - async unpinMessage(message: StreamMessage) { + async unpinMessage(message: StreamMessage) { try { await this.chatClientService.chatClient?.unpinMessage(message); this.notificationService.addTemporaryNotification( @@ -1346,7 +1352,7 @@ export class ChannelService< } } - private handleNotification(clientEvent: ClientEvent) { + private handleNotification(clientEvent: ClientEvent) { switch (clientEvent.eventType) { case 'connection.recovered': { void this.ngZone.run(async () => { @@ -1369,7 +1375,7 @@ export class ChannelService< // Update and reselect message to quote const messageToQuote = this.messageToQuoteSubject.getValue(); this.setChannelState(this.activeChannelSubject.getValue()!); - let messages!: StreamMessage[]; + let messages!: StreamMessage[]; this.activeChannelMessages$ .pipe(take(1)) .subscribe((m) => (messages = m)); @@ -1445,7 +1451,7 @@ export class ChannelService< ); this.activeChannelMessagesSubject.next( activeChannel.state.messages.map((m) => { - m.readBy = getReadBy(m, activeChannel); + (m as StreamMessage).readBy = getReadBy(m, activeChannel); return { ...m }; }) ); @@ -1456,7 +1462,7 @@ export class ChannelService< this.activeThreadMessagesSubject.next([...messages]); } this.activeChannelPinnedMessagesSubject.next([ - ...activeChannel.state.pinnedMessages, + ...(activeChannel.state.pinnedMessages as StreamMessage[]), ]); } }); @@ -1465,26 +1471,24 @@ export class ChannelService< } } - private handleRemovedFromChannelNotification(clientEvent: ClientEvent) { + private handleRemovedFromChannelNotification(clientEvent: ClientEvent) { const channelIdToBeRemoved = clientEvent.event.channel!.cid; this.removeChannel(channelIdToBeRemoved, true); } - private handleNewMessageNotification(clientEvent: ClientEvent) { + private handleNewMessageNotification(clientEvent: ClientEvent) { if (clientEvent.event.channel) { void this.addChannelFromNotification(clientEvent.event.channel); } } - private handleAddedToChannelNotification(clientEvent: ClientEvent) { + private handleAddedToChannelNotification(clientEvent: ClientEvent) { if (clientEvent.event.channel) { void this.addChannelFromNotification(clientEvent.event.channel); } } - private async addChannelFromNotification( - channelResponse: ChannelResponse - ) { + private async addChannelFromNotification(channelResponse: ChannelResponse) { const newChannel = this.chatClientService.chatClient.channel( channelResponse.type, channelResponse.id @@ -1508,7 +1512,7 @@ export class ChannelService< this.channelsSubject.next([newChannel, ...currentChannels]); } - private watchForActiveChannelEvents(channel: Channel) { + private watchForActiveChannelEvents(channel: Channel) { this.activeChannelSubscriptions.push( channel.on('message.new', (event) => { this.ngZone.run(() => { @@ -1657,7 +1661,7 @@ export class ChannelService< * @returns all reactions of a message */ async getMessageReactions(messageId: string) { - const reactions: ReactionResponse[] = []; + const reactions: ReactionResponse[] = []; const limit = 300; let offset = 0; const reactionsLimit = ChannelService.MAX_MESSAGE_REACTIONS_TO_FETCH; @@ -1738,7 +1742,7 @@ export class ChannelService< } } - private messageUpdated(event: Event) { + private messageUpdated(event: Event) { this.ngZone.run(() => { const isThreadReply = event.message && event.message.parent_id; const channel = this.activeChannelSubject.getValue(); @@ -1746,7 +1750,7 @@ export class ChannelService< return; } // Get messages from state as message order could change, and message could've been deleted - const messages: FormatMessageResponse[] = isThreadReply + const messages: FormatMessageResponse[] = isThreadReply ? channel.state.threads[event?.message?.parent_id || ''] : channel.state.messages; if (!messages) { @@ -1760,13 +1764,13 @@ export class ChannelService< ? this.activeThreadMessagesSubject.next([...messages]) : this.activeChannelMessagesSubject.next([...messages]); this.activeChannelPinnedMessagesSubject.next([ - ...channel.state.pinnedMessages, + ...(channel.state.pinnedMessages as StreamMessage[]), ]); } }); } - private messageReactionEventReceived(e: Event) { + private messageReactionEventReceived(e: Event) { this.ngZone.run(() => { const isThreadMessage = e.message && e.message.parent_id; let messages!: StreamMessage[]; @@ -1794,8 +1798,8 @@ export class ChannelService< }); } - private formatMessage(message: MessageResponse) { - const m = message as unknown as FormatMessageResponse; + private formatMessage(message: MessageResponse) { + const m = message as unknown as FormatMessageResponse; m.pinned_at = message.pinned_at ? new Date(message.pinned_at) : null; m.created_at = message.created_at ? new Date(message.created_at) @@ -1811,7 +1815,7 @@ export class ChannelService< private isStreamMessage( message: StreamMessage | FormatMessageResponse | MessageResponse ): message is StreamMessage { - return !!message.readBy; + return 'readBy' in message; } private isFormatMessageResponse( @@ -1820,7 +1824,7 @@ export class ChannelService< return message.created_at instanceof Date; } - private stopWatchForActiveChannelEvents(channel: Channel | undefined) { + private stopWatchForActiveChannelEvents(channel: Channel | undefined) { if (!channel) { return; } @@ -1881,11 +1885,11 @@ export class ChannelService< } } - private watchForChannelEvents(channel: Channel) { + private watchForChannelEvents(channel: Channel) { if (this.channelSubscriptions[channel.cid]) { this.channelSubscriptions[channel.cid](); } - const unsubscribe = channel.on((event: Event) => { + const unsubscribe = channel.on((event: Event) => { // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const type = event.type as EventTypes | 'capabilities.changed'; switch (type) { @@ -2014,7 +2018,7 @@ export class ChannelService< this.channelSubscriptions[channel.cid] = unsubscribe.unsubscribe; } - private handleNewMessage(_: Event, channel: Channel) { + private handleNewMessage(_: Event, channel: Channel) { const channelIndex = this.channels.findIndex((c) => c.cid === channel.cid); this.channels.splice(channelIndex, 1); this.channelsSubject.next([channel, ...this.channels]); @@ -2028,7 +2032,7 @@ export class ChannelService< this.removeChannel(event.channel!.cid, false); } - private handleChannelVisible(event: Event, channel: Channel) { + private handleChannelVisible(event: Event, channel: Channel) { if (!this.channels.find((c) => c.cid === event.cid)) { this.ngZone.run(() => this.channelsSubject.next([...this.channels, channel]) @@ -2036,7 +2040,7 @@ export class ChannelService< } } - private handleChannelUpdate(event: Event) { + private handleChannelUpdate(event: Event) { const channelIndex = this.channels.findIndex( (c) => c.cid === event.channel!.cid ); @@ -2085,8 +2089,8 @@ export class ChannelService< } private transformToStreamMessage( - message: StreamMessage | MessageResponse | FormatMessageResponse, - channel?: Channel + message: StreamMessage | MessageResponse | FormatMessageResponse, + channel?: Channel ) { const isThreadMessage = !!message.parent_id; if ( @@ -2108,38 +2112,39 @@ export class ChannelService< return message; } else { if (message.quoted_message) { - message.quoted_message.translation = getMessageTranslation( - message.quoted_message, - channel, - this.chatClientService.chatClient.user - ); + (message as StreamMessage).quoted_message!.translation = + getMessageTranslation( + message.quoted_message, + channel, + this.chatClientService.chatClient.user + ); } if (this.isFormatMessageResponse(message)) { - message.readBy = isThreadMessage + (message as StreamMessage).readBy = isThreadMessage ? [] : channel ? getReadBy(message, channel) : []; - message.translation = getMessageTranslation( + (message as StreamMessage).translation = getMessageTranslation( message, channel, this.chatClientService.chatClient.user ); - return message; + return message as StreamMessage; } else { message = this.formatMessage(message); - message.readBy = isThreadMessage + (message as StreamMessage).readBy = isThreadMessage ? [] : channel ? getReadBy(message, channel) : []; - message.translation = getMessageTranslation( + (message as StreamMessage).translation = getMessageTranslation( message, channel, this.chatClientService.chatClient.user ); - return message; + return message as StreamMessage; } } } @@ -2215,26 +2220,27 @@ export class ChannelService< } } - private setChannelState(channel: Channel) { + private setChannelState(channel: Channel) { channel.state.messages.forEach((m) => { - m.readBy = getReadBy(m, channel); - m.translation = getMessageTranslation( + (m as StreamMessage).readBy = getReadBy(m, channel); + (m as StreamMessage).translation = getMessageTranslation( m, channel, this.chatClientService.chatClient.user ); if (m.quoted_message) { - m.quoted_message.translation = getMessageTranslation( - m.quoted_message, - channel, - this.chatClientService.chatClient.user - ); + (m as StreamMessage).quoted_message!.translation = + getMessageTranslation( + m.quoted_message, + channel, + this.chatClientService.chatClient.user + ); } }); this.markRead(channel); this.activeChannelMessagesSubject.next([...channel.state.messages]); this.activeChannelPinnedMessagesSubject.next([ - ...channel.state.pinnedMessages, + ...(channel.state.pinnedMessages as StreamMessage[]), ]); this.activeParentMessageIdSubject.next(undefined); this.activeThreadMessagesSubject.next([]); @@ -2243,7 +2249,7 @@ export class ChannelService< this.usersTypingInThreadSubject.next([]); } - private markRead(channel: Channel, isThrottled = true) { + private markRead(channel: Channel, isThrottled = true) { if ( this.canSendReadEvents && this.shouldMarkActiveChannelAsRead && @@ -2257,7 +2263,7 @@ export class ChannelService< } } - private markReadThrottled(channel: Channel) { + private markReadThrottled(channel: Channel) { if (!this.markReadTimeout) { this.markRead(channel, false); this.markReadTimeout = setTimeout(() => { diff --git a/projects/stream-chat-angular/src/lib/chat-client.service.spec.ts b/projects/stream-chat-angular/src/lib/chat-client.service.spec.ts index f1dd117c..162d12fb 100644 --- a/projects/stream-chat-angular/src/lib/chat-client.service.spec.ts +++ b/projects/stream-chat-angular/src/lib/chat-client.service.spec.ts @@ -7,10 +7,9 @@ import { MockStreamChatClient, } from './mocks'; import { NotificationService } from './notification.service'; -import { DefaultStreamChatGenerics } from './types'; describe('ChatClientService', () => { - let service: ChatClientService; + let service: ChatClientService; let mockChatClient: MockStreamChatClient; let apiKey: string; let userId: string; @@ -129,7 +128,7 @@ describe('ChatClientService', () => { const user = { id: userId, name: 'Test user', - } as OwnUserResponse; + } as OwnUserResponse; mockChatClient.connectUser.calls.reset(); await service.init(apiKey, user, userToken); @@ -140,7 +139,7 @@ describe('ChatClientService', () => { const user = { id: userId, name: 'Test user', - } as OwnUserResponse; + } as OwnUserResponse; const options = { timeout: 5000 }; await service.init(apiKey, user, userToken, options); diff --git a/projects/stream-chat-angular/src/lib/chat-client.service.ts b/projects/stream-chat-angular/src/lib/chat-client.service.ts index 0a7f8524..eec1e995 100644 --- a/projects/stream-chat-angular/src/lib/chat-client.service.ts +++ b/projects/stream-chat-angular/src/lib/chat-client.service.ts @@ -13,14 +13,11 @@ import { import { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat'; import { version } from '../assets/version'; import { NotificationService } from './notification.service'; -import { DefaultStreamChatGenerics } from './types'; import { take } from 'rxjs/operators'; -export type ClientEvent< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { +export type ClientEvent = { eventType: string; - event: Event; + event: Event; }; /** @@ -29,20 +26,18 @@ export type ClientEvent< @Injectable({ providedIn: 'root', }) -export class ChatClientService< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> { +export class ChatClientService { /** * The [StreamChat client](https://github.com/GetStream/stream-chat-js/blob/master/src/client.ts) instance. In general you shouldn't need to access the client, but it's there if you want to use it. */ - chatClient!: StreamChat; + chatClient!: StreamChat; /** * Emits [`ClientEvent`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/chat-client.service.ts) events. The platform documentation covers [the list of client, user presence and notification events](/chat/docs/javascript/event_object/). * :::important * For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail. * ::: */ - events$: Observable>; + events$: Observable; /** * Emits the current [application settings](/chat/docs/javascript/app_setting_overview/). Since getting the application settings is an expensive API call and we don't always need the result, this is not initialized by default, you need to call `getApplicationSettings` to load them. */ @@ -54,23 +49,23 @@ export class ChatClientService< /** * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](/chat/docs/sdk/angular/code-examples/channel-invites/) guide. */ - pendingInvites$: Observable[]>; + pendingInvites$: Observable; /** * Emits the current chat user */ - user$: Observable | UserResponse | undefined>; - private notificationSubject = new ReplaySubject>(1); + user$: Observable; + private notificationSubject = new ReplaySubject(1); private connectionStateSubject = new ReplaySubject<'offline' | 'online'>(1); private appSettingsSubject = new BehaviorSubject( undefined ); - private pendingInvitesSubject = new BehaviorSubject[]>([]); + private pendingInvitesSubject = new BehaviorSubject([]); private userSubject = new ReplaySubject< - OwnUserResponse | UserResponse | undefined + OwnUserResponse | UserResponse | undefined >(1); private subscriptions: { unsubscribe: () => void }[] = []; private trackPendingChannelInvites = true; - private appSettingsPromise?: Promise>; + private appSettingsPromise?: Promise; constructor( private ngZone: NgZone, @@ -97,19 +92,19 @@ export class ChatClientService< */ async init( apiKey: string, - userOrId: string | OwnUserResponse | UserResponse | undefined, + userOrId: string | OwnUserResponse | UserResponse | undefined, userTokenOrProvider: TokenOrProvider, clientOptions?: StreamChatOptions & { trackPendingChannelInvites?: boolean; } - ): ConnectAPIResponse { + ): ConnectAPIResponse { if (this.chatClient && this.chatClient.key !== apiKey) { this.appSettingsSubject.next(undefined); this.appSettingsPromise = undefined; } this.trackPendingChannelInvites = clientOptions?.trackPendingChannelInvites === true; - this.chatClient = StreamChat.getInstance(apiKey, clientOptions); + this.chatClient = StreamChat.getInstance(apiKey, clientOptions); if ('sdkIdentifier' in this.chatClient) { // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access (this.chatClient as any).sdkIdentifier = { @@ -156,7 +151,7 @@ export class ChatClientService< { invite: 'pending', members: { $in: [this.chatClient.user?.id] }, - } as unknown as ChannelFilters // TODO: find out why we need this typecast + } as unknown as ChannelFilters // TODO: find out why we need this typecast ); this.pendingInvitesSubject.next(channels); } @@ -242,11 +237,11 @@ export class ChatClientService< { id: { $autocomplete: searchTerm } }, { name: { $autocomplete: searchTerm } }, ], - } as UserFilters); // TODO: find out why we need this typecast + } as UserFilters); // TODO: find out why we need this typecast return result.users.filter((u) => u.id !== this.chatClient?.user?.id); } - private updatePendingInvites(e: Event) { + private updatePendingInvites(e: Event) { if (!this.trackPendingChannelInvites) { return; } @@ -270,13 +265,17 @@ export class ChatClientService< } } - private updateUser(e: Event) { + private updateUser(e: Event) { if (typeof e.total_unread_count !== 'undefined') { - let user: OwnUserResponse | UserResponse | undefined; + let user: OwnUserResponse | UserResponse | undefined; this.userSubject.pipe(take(1)).subscribe((u) => { user = u; }); - if (user && user.total_unread_count !== e.total_unread_count) { + if ( + user && + 'total_unread_count' in user && + user.total_unread_count !== e.total_unread_count + ) { this.userSubject.next({ ...user, total_unread_count: e.total_unread_count, @@ -284,11 +283,15 @@ export class ChatClientService< } } if (typeof e.unread_channels !== 'undefined') { - let user: OwnUserResponse | UserResponse | undefined; + let user: OwnUserResponse | UserResponse | undefined; this.userSubject.pipe(take(1)).subscribe((u) => { user = u; }); - if (user && user.unread_channels !== e.unread_channels) { + if ( + user && + 'unread_channels' in user && + user.unread_channels !== e.unread_channels + ) { this.userSubject.next({ ...user, unread_channels: e.unread_channels, @@ -296,11 +299,15 @@ export class ChatClientService< } } if (typeof e.unread_count !== 'undefined') { - let user: OwnUserResponse | UserResponse | undefined; + let user: OwnUserResponse | UserResponse | undefined; this.userSubject.pipe(take(1)).subscribe((u) => { user = u; }); - if (user && user.unread_count !== e.unread_count) { + if ( + user && + 'unread_count' in user && + user.unread_count !== e.unread_count + ) { this.userSubject.next({ ...user, unread_count: e.unread_count, diff --git a/projects/stream-chat-angular/src/lib/custom-templates.service.ts b/projects/stream-chat-angular/src/lib/custom-templates.service.ts index 18661998..d643e98b 100644 --- a/projects/stream-chat-angular/src/lib/custom-templates.service.ts +++ b/projects/stream-chat-angular/src/lib/custom-templates.service.ts @@ -15,9 +15,9 @@ import { CustomAttachmentUploadContext, CustomMetadataContext, DateSeparatorContext, - DefaultStreamChatGenerics, DeliveredStatusContext, EmojiPickerContext, + GalleryAttachmentContext, IconContext, MentionAutcompleteListItemContext, MentionTemplateContext, @@ -49,9 +49,7 @@ import { @Injectable({ providedIn: 'root', }) -export class CustomTemplatesService< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> { +export class CustomTemplatesService { /** * The autocomplete list item template for mentioning users (used in the [`AutocompleteTextareaComponent`](/chat/docs/sdk/angular/components/AutocompleteTextareaComponent/)) */ @@ -222,7 +220,7 @@ export class CustomTemplatesService< * */ customMessageMetadataTemplate$ = new BehaviorSubject< - TemplateRef> | undefined + TemplateRef | undefined >(undefined); /** * The template used to display additional information about a channel under the channel name inside the [channel header component](/chat/docs/sdk/angular/components/ChannelHeaderComponent/) @@ -260,7 +258,7 @@ export class CustomTemplatesService< * The template that can be used to override how image gallery is displayed inside the [attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/) */ galleryAttachmentTemplate$ = new BehaviorSubject< - TemplateRef | undefined + TemplateRef | undefined >(undefined); /** * The template that can be used to override how a file attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/) diff --git a/projects/stream-chat-angular/src/lib/get-channel-display-text.spec.ts b/projects/stream-chat-angular/src/lib/get-channel-display-text.spec.ts index 7cf1503c..cf006c43 100644 --- a/projects/stream-chat-angular/src/lib/get-channel-display-text.spec.ts +++ b/projects/stream-chat-angular/src/lib/get-channel-display-text.spec.ts @@ -1,7 +1,6 @@ import { Channel } from 'stream-chat'; import { getChannelDisplayText } from './get-channel-display-text'; import { listUsers } from './list-users'; -import { DefaultStreamChatGenerics } from './types'; describe('getChannelDisplayText', () => { it('should display channel name if it is defined', () => { @@ -12,7 +11,7 @@ describe('getChannelDisplayText', () => { name: 'Hobby Chefs🧁🥩🥗🥑🥘', members: [{ id: 'hobby-chef1' }, { id: 'hobby-chef2' }], }, - } as any as Channel; + } as any as Channel; expect(getChannelDisplayText(channel, currentUser)).toBe( 'Hobby Chefs🧁🥩🥗🥑🥘' @@ -37,7 +36,7 @@ describe('getChannelDisplayText', () => { [currentUser.id]: { user: currentUser }, }, }, - } as Channel; + } as Channel; expect(getChannelDisplayText(channel, currentUser)).toBe( listUsers(members) @@ -62,7 +61,7 @@ describe('getChannelDisplayText', () => { [currentUser.id]: { user: currentUser }, }, }, - } as Channel; + } as Channel; expect(getChannelDisplayText(channel, currentUser)).not.toContain( currentUser.id @@ -80,7 +79,7 @@ describe('getChannelDisplayText', () => { state: { members: {}, }, - } as Channel; + } as Channel; expect(getChannelDisplayText(channel, currentUser)).toBe('hobby-chefs'); diff --git a/projects/stream-chat-angular/src/lib/get-channel-display-text.ts b/projects/stream-chat-angular/src/lib/get-channel-display-text.ts index 3b5649b3..3bdb82ee 100644 --- a/projects/stream-chat-angular/src/lib/get-channel-display-text.ts +++ b/projects/stream-chat-angular/src/lib/get-channel-display-text.ts @@ -1,10 +1,9 @@ import { Channel, UserResponse } from 'stream-chat'; import { listUsers } from './list-users'; -import { DefaultStreamChatGenerics } from './types'; export const getChannelDisplayText = ( - channel: Channel, - currentUser: UserResponse + channel: Channel, + currentUser: UserResponse ) => { if (channel.data?.name) { return channel.data.name; diff --git a/projects/stream-chat-angular/src/lib/get-message-translation.ts b/projects/stream-chat-angular/src/lib/get-message-translation.ts index 32bf8119..f09ae2d6 100644 --- a/projects/stream-chat-angular/src/lib/get-message-translation.ts +++ b/projects/stream-chat-angular/src/lib/get-message-translation.ts @@ -3,16 +3,14 @@ import { FormatMessageResponse, MessageResponse, TranslationLanguages, - User, + UserResponse, } from 'stream-chat'; -import { DefaultStreamChatGenerics, StreamMessage } from './types'; +import { StreamMessage } from './types'; -export const getMessageTranslation = < - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ->( +export const getMessageTranslation = ( message?: StreamMessage | MessageResponse | FormatMessageResponse, - channel?: Channel, - user?: User + channel?: Channel, + user?: UserResponse ) => { const language = user?.language || diff --git a/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.spec.ts b/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.spec.ts index 4413020a..601392eb 100644 --- a/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.spec.ts @@ -19,7 +19,7 @@ import { MockStreamChatClient, } from '../mocks'; import { NotificationService } from '../notification.service'; -import { DefaultStreamChatGenerics, StreamMessage } from '../types'; +import { StreamMessage } from '../types'; import { MessageActionsBoxComponent } from './message-actions-box.component'; import { MessageActionsService } from '../message-actions.service'; @@ -45,7 +45,7 @@ describe('MessageActionsBoxComponent', () => { let mockChatClient: MockStreamChatClient; let channelService: { updateMessage: jasmine.Spy; - activeChannel$: Observable>; + activeChannel$: Observable; deleteMessage: jasmine.Spy; selectMessageToQuote: jasmine.Spy; messageToQuote$: Observable; @@ -189,8 +189,7 @@ describe('MessageActionsBoxComponent', () => { it(`shouldn't disable quote action, if message already has a quoted message`, () => { component.message = { ...component.message!, - quoted_message: - mockMessage() as any as MessageResponseBase, + quoted_message: mockMessage() as any as MessageResponseBase, }; component.enabledActions = ['quote-message']; component.ngOnChanges({ diff --git a/projects/stream-chat-angular/src/lib/message-actions.service.ts b/projects/stream-chat-angular/src/lib/message-actions.service.ts index 75413f6d..9f38f5b5 100644 --- a/projects/stream-chat-angular/src/lib/message-actions.service.ts +++ b/projects/stream-chat-angular/src/lib/message-actions.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject, combineLatest } from 'rxjs'; import { CustomMessageActionItem, - DefaultStreamChatGenerics, MessageActionHandlerExtraParams, MessageActionItem, MessageActionsClickDetails, @@ -19,16 +18,11 @@ import { ChannelService } from './channel.service'; @Injectable({ providedIn: 'root', }) -export class MessageActionsService< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> { +export class MessageActionsService { /** * Default actions - these are the actions that are handled by the built-in component */ - readonly defaultActions: ( - | MessageActionItem - | MessageReactionActionItem - )[] = [ + readonly defaultActions: (MessageActionItem | MessageReactionActionItem)[] = [ { actionName: 'react', isVisible: (enabledActions: string[]) => { @@ -38,19 +32,19 @@ export class MessageActionsService< { actionName: 'mark-unread', actionLabelOrTranslationKey: 'streamChat.Mark as unread', - actionHandler: (message: StreamMessage) => { + actionHandler: (message: StreamMessage) => { void this.channelService.markMessageUnread(message.id); }, isVisible: ( enabledActions: string[], _: boolean, - message: StreamMessage + message: StreamMessage ) => enabledActions.indexOf('read-events') !== -1 && !message.parent_id, }, { actionName: 'quote', actionLabelOrTranslationKey: 'streamChat.Reply', - actionHandler: (message: StreamMessage) => { + actionHandler: (message: StreamMessage) => { this.channelService.selectMessageToQuote(message); }, isVisible: (enabledActions: string[]) => @@ -59,20 +53,20 @@ export class MessageActionsService< { actionName: 'thread-reply', actionLabelOrTranslationKey: 'streamChat.Thread', - actionHandler: (message: StreamMessage) => { + actionHandler: (message: StreamMessage) => { void this.channelService.setAsActiveParentMessage(message); }, isVisible: ( enabledActions: string[], _: boolean, - message: StreamMessage + message: StreamMessage ) => enabledActions.indexOf('send-reply') !== -1 && !message.parent_id, }, { actionName: 'pin', - actionLabelOrTranslationKey: (message: StreamMessage) => + actionLabelOrTranslationKey: (message: StreamMessage) => message.pinned ? 'streamChat.Unpin' : 'streamChat.Pin', - actionHandler: (message: StreamMessage) => { + actionHandler: (message: StreamMessage) => { message.pinned ? void this.channelService.unpinMessage(message) : void this.channelService.pinMessage(message); @@ -84,7 +78,7 @@ export class MessageActionsService< actionName: 'flag', actionLabelOrTranslationKey: 'streamChat.Flag', // eslint-disable-next-line @typescript-eslint/no-misused-promises - actionHandler: async (message: StreamMessage) => { + actionHandler: async (message: StreamMessage) => { try { await this.chatClientService.flagMessage(message.id); this.notificationService.addTemporaryNotification( @@ -103,7 +97,7 @@ export class MessageActionsService< { actionName: 'edit', actionLabelOrTranslationKey: 'streamChat.Edit Message', - actionHandler: (message: StreamMessage) => { + actionHandler: (message: StreamMessage) => { this.messageToEdit$.next(message); }, isVisible: (enabledActions: string[], isMine: boolean) => @@ -114,7 +108,7 @@ export class MessageActionsService< actionName: 'delete', actionLabelOrTranslationKey: 'streamChat.Delete', // eslint-disable-next-line @typescript-eslint/no-misused-promises - actionHandler: async (message: StreamMessage) => { + actionHandler: async (message: StreamMessage) => { try { await this.channelService.deleteMessage(message); } catch (error) { @@ -133,7 +127,7 @@ export class MessageActionsService< { actionName: 'copy-message-text', actionLabelOrTranslationKey: 'streamChat.Copy text', - isVisible: (_: string[], __: boolean, message: StreamMessage) => { + isVisible: (_: string[], __: boolean, message: StreamMessage) => { const isClipboardSupported = navigator?.clipboard?.write !== undefined; if (!isClipboardSupported && !this.hasDisplayedClipboardWarning) { console.warn( @@ -148,7 +142,7 @@ export class MessageActionsService< ); }, actionHandler: ( - message: StreamMessage, + message: StreamMessage, extraParams: MessageActionHandlerExtraParams ) => { const fallbackContent = message.text || ''; @@ -177,7 +171,7 @@ export class MessageActionsService< /** * The built-in components will handle changes to this observable. */ - messageToEdit$ = new BehaviorSubject | undefined>(undefined); + messageToEdit$ = new BehaviorSubject(undefined); /** * You can pass your own custom actions that will be displayed inside the built-in message actions component */ @@ -185,7 +179,7 @@ export class MessageActionsService< /** * By default the [`MessageComponent`](/chat/docs/sdk/angular/components/MessageComponent/) will display the [`MessageActionsBoxComponent`](/chat/docs/sdk/angular/components/MessageActionsBoxComponent/). You can override that behavior by providing your own event handler. */ - customActionClickHandler?: (details: MessageActionsClickDetails) => void; + customActionClickHandler?: (details: MessageActionsClickDetails) => void; /** * @internal */ @@ -229,7 +223,7 @@ export class MessageActionsService< * @returns the count */ getAuthorizedMessageActionsCount( - message: StreamMessage, + message: StreamMessage, enabledActions: string[] ) { const customActions = this.customActions$.getValue() || []; diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.spec.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.spec.ts index 20cbcb5b..db993fef 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.spec.ts @@ -14,7 +14,6 @@ import { mockChannelService, MockChannelService } from '../../mocks'; import { AutocompleteTextareaComponent } from './autocomplete-textarea.component'; import { Subject } from 'rxjs'; import { EmojiInputService } from '../emoji-input.service'; -import { DefaultStreamChatGenerics } from '../../types'; describe('AutocompleteTextareaComponent', () => { let component: AutocompleteTextareaComponent; @@ -219,7 +218,7 @@ describe('AutocompleteTextareaComponent', () => { getConfig: () => ({ commands: [], }), - } as any as Channel); + } as any as Channel); fixture.detectChanges(); await fixture.whenStable(); diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts index a2fc51fe..8b5517e8 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts @@ -300,7 +300,9 @@ export class AutocompleteTextareaComponent triggerChar = '' ) { if (triggerChar === this.mentionTriggerChar) { - this.mentionedUsers.push((item.user ? item.user : item) as UserResponse); + this.mentionedUsers.push( + ('user' in item ? item.user : item) as UserResponse + ); this.userMentions.next([...this.mentionedUsers]); } this.searchTerm$.next(''); @@ -369,7 +371,7 @@ export class AutocompleteTextareaComponent const items = this.filter( searchTerm || '', result.map((i) => { - const user = (i.user ? i.user : i) as UserResponse; + const user = ('user' in i ? i.user : i) as UserResponse; return { ...i, autocompleteLabel: user.name || user.id, diff --git a/projects/stream-chat-angular/src/lib/message-input/message-input.component.spec.ts b/projects/stream-chat-angular/src/lib/message-input/message-input.component.spec.ts index 716dedd9..669e8c9e 100644 --- a/projects/stream-chat-angular/src/lib/message-input/message-input.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/message-input/message-input.component.spec.ts @@ -22,11 +22,7 @@ import { mockMessage, } from '../mocks'; import { NotificationService } from '../notification.service'; -import { - AttachmentUpload, - DefaultStreamChatGenerics, - StreamMessage, -} from '../types'; +import { AttachmentUpload, StreamMessage } from '../types'; import { MessageInputComponent } from './message-input.component'; import { TextareaDirective } from './textarea.directive'; import { AutocompleteTextareaComponent } from './autocomplete-textarea/autocomplete-textarea.component'; @@ -51,11 +47,11 @@ describe('MessageInputComponent', () => { let queryCooldownTimer: () => HTMLElement | null; let queryAttachmentPreviewList: () => AttachmentPreviewListComponent; let queryVoiceRecorderButton: () => HTMLButtonElement | null; - let mockActiveChannel$: BehaviorSubject>; + let mockActiveChannel$: BehaviorSubject; let mockActiveParentMessageId$: BehaviorSubject; let sendMessageSpy: jasmine.Spy; let updateMessageSpy: jasmine.Spy; - let channel: Channel; + let channel: Channel; let user: UserResponse; let attachmentService: { attachmentsCounter$: BehaviorSubject; @@ -332,7 +328,7 @@ describe('MessageInputComponent', () => { mockActiveChannel$.next({ ...channel, data: { own_capabilities: [] }, - } as any as Channel); + } as any as Channel); fixture.detectChanges(); expect(queryattachmentUploadButton()).toBeNull(); @@ -505,7 +501,7 @@ describe('MessageInputComponent', () => { component.textareaValue = 'text'; mockActiveChannel$.next({ getConfig: () => ({ commands: [] }), - } as any as Channel); + } as any as Channel); fixture.detectChanges(); expect(component.textareaValue).toBe(''); @@ -524,7 +520,7 @@ describe('MessageInputComponent', () => { mockActiveChannel$.next({ ...mockActiveChannel$.getValue(), getConfig: () => ({ commands: [] }), - } as any as Channel); + } as any as Channel); fixture.detectChanges(); expect(component.textareaValue).toBe('text'); @@ -603,7 +599,7 @@ describe('MessageInputComponent', () => { mockActiveChannel$.next({ data: { own_capabilities: [] }, getConfig: () => ({ commands: [] }), - } as any as Channel); + } as any as Channel); fixture.detectChanges(); await fixture.whenStable(); @@ -668,14 +664,14 @@ describe('MessageInputComponent', () => { mockActiveChannel$.next({ data: { own_capabilities: [] }, getConfig: () => ({ commands: [] }), - } as any as Channel); + } as any as Channel); expect(component.canSendMessages).toBeFalse(); mockActiveChannel$.next({ data: { own_capabilities: [] }, getConfig: () => ({ commands: [] }), - } as any as Channel); + } as any as Channel); expect(component.canSendMessages).toBeFalse(); @@ -730,7 +726,7 @@ describe('MessageInputComponent', () => { mockActiveChannel$.next({ data: { own_capabilities: ['send-message'] }, getConfig: () => ({ commands: [] }), - } as any as Channel); + } as any as Channel); expect(component.canSendMessages).toBeFalse(); }); @@ -763,7 +759,7 @@ describe('MessageInputComponent', () => { const quotedMessageContainerSelector = '[data-testid="quoted-message-container"]'; const message = mockMessage(); - message.attachments = [{ id: '1' }, { id: '2' }]; + message.attachments = [{ image_url: '1' }, { image_url: '2' }]; mockMessageToQuote$.next(message); fixture.detectChanges(); @@ -784,7 +780,7 @@ describe('MessageInputComponent', () => { expect(avatar.type).toBe('user'); expect(avatar.location).toBe('quoted-message-sender'); expect(avatar.user).toBe(message.user!); - expect(attachments.attachments).toEqual([{ id: '1' }]); + expect(attachments.attachments).toEqual([{ image_url: '1' }]); const textComponent = fixture.debugElement .query(By.css(quotedMessageContainerSelector)) diff --git a/projects/stream-chat-angular/src/lib/message-input/message-input.component.ts b/projects/stream-chat-angular/src/lib/message-input/message-input.component.ts index e17fcb05..c67cf21f 100644 --- a/projects/stream-chat-angular/src/lib/message-input/message-input.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/message-input.component.ts @@ -32,7 +32,6 @@ import { AttachmentUpload, AudioRecording, CustomAttachmentUploadContext, - DefaultStreamChatGenerics, EmojiPickerContext, MessageTextContext, StreamMessage, @@ -148,7 +147,7 @@ export class MessageInputComponent private subscriptions: Subscription[] = []; private hideNotification: (() => void) | undefined; private isViewInited = false; - private channel: Channel | undefined; + private channel: Channel | undefined; private sendMessageSubcription: Subscription | undefined; private readonly defaultTextareaPlaceholder = 'streamChat.Type your message'; private readonly slowModeTextareaPlaceholder = 'streamChat.Slow Mode ON'; @@ -246,7 +245,7 @@ export class MessageInputComponent map( ([latestMessages, channel]): [ Date | undefined, - Channel | undefined + Channel | undefined ] => [latestMessages[channel?.cid || ''], channel!] ) ) diff --git a/projects/stream-chat-angular/src/lib/message-list/message-list.component.spec.ts b/projects/stream-chat-angular/src/lib/message-list/message-list.component.spec.ts index f3bead5a..a1b98769 100644 --- a/projects/stream-chat-angular/src/lib/message-list/message-list.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/message-list/message-list.component.spec.ts @@ -24,7 +24,6 @@ import { mockMessage, } from '../mocks'; import { StreamI18nService } from '../stream-i18n.service'; -import { DefaultStreamChatGenerics } from '../types'; import { MessageListComponent } from './message-list.component'; import { take } from 'rxjs/operators'; import { NgxFloatUiModule } from 'ngx-float-ui'; @@ -354,7 +353,7 @@ describe('MessageListComponent', () => { channelServiceMock.activeChannel$.next({ id: 'nextchannel', on: () => {}, - } as any as Channel); + } as any as Channel); channelServiceMock.activeChannel!.state.latestMessages = []; channelServiceMock.activeChannelMessages$.next([]); fixture.detectChanges(); @@ -511,7 +510,7 @@ describe('MessageListComponent', () => { })); it('should get unread message information from "message.new" event if an older message list is displayed', () => { - let channel!: Channel; + let channel!: Channel; channelServiceMock.activeChannel$ .pipe(take(1)) .subscribe((c) => (channel = c!)); diff --git a/projects/stream-chat-angular/src/lib/message-list/message-list.component.ts b/projects/stream-chat-angular/src/lib/message-list/message-list.component.ts index 69cd4c92..9945c143 100644 --- a/projects/stream-chat-angular/src/lib/message-list/message-list.component.ts +++ b/projects/stream-chat-angular/src/lib/message-list/message-list.component.ts @@ -27,7 +27,6 @@ import { } from 'rxjs/operators'; import { MessageContext, - DefaultStreamChatGenerics, StreamMessage, TypingIndicatorContext, DateSeparatorContext, @@ -135,12 +134,8 @@ export class MessageListComponent private isNewMessageSentByUser: boolean = false; private subscriptions: Subscription[] = []; private newMessageSubscription: { unsubscribe: () => void } | undefined; - private usersTypingInChannel$!: Observable< - UserResponse[] - >; - private usersTypingInThread$!: Observable< - UserResponse[] - >; + private usersTypingInChannel$!: Observable; + private usersTypingInThread$!: Observable; private isLatestMessageInList = true; private channelId?: string; private parsedDates = new Map(); diff --git a/projects/stream-chat-angular/src/lib/message-preview.spec.ts b/projects/stream-chat-angular/src/lib/message-preview.spec.ts index d9a0749e..a3d97352 100644 --- a/projects/stream-chat-angular/src/lib/message-preview.spec.ts +++ b/projects/stream-chat-angular/src/lib/message-preview.spec.ts @@ -1,14 +1,11 @@ import { mockCurrentUser } from './mocks'; import { createMessagePreview } from './message-preview'; -import { - DefaultAttachmentType, - DefaultChannelType, - DefaultStreamChatGenerics, - DefaultUserType, - StreamMessage, - UnknownType, -} from './types'; -import { LiteralStringForUnion } from 'stream-chat'; +declare module 'stream-chat' { + interface CustomMessageData { + isVote?: boolean; + options?: string[]; + } +} describe('createMessagePreview', () => { it('should create message preview', () => { @@ -21,21 +18,7 @@ describe('createMessagePreview', () => { const users = [{ id: 'jack', name: 'Jack' }]; const parentId = 'parentId'; const quotedMessageId = 'quotedMessageId'; - type MyMessageType = StreamMessage & { - isVote: boolean; - results: number[]; - options: string[]; - }; - type MyGenerics = DefaultStreamChatGenerics & { - messageType: MyMessageType; - attachmentType: DefaultAttachmentType; - channelType: DefaultChannelType; - commandType: LiteralStringForUnion; - eventType: UnknownType; - reactionType: UnknownType; - userType: DefaultUserType; - }; - const preview = createMessagePreview( + const preview = createMessagePreview( user, text, attachments, @@ -50,6 +33,7 @@ describe('createMessagePreview', () => { expect(preview.created_at).not.toBeUndefined(); expect(preview.html).toBe(text); + // @ts-expect-error internal property expect(preview.__html).toBe(text); expect(preview.user).toBe(user); expect(preview.id).toContain(user.id); diff --git a/projects/stream-chat-angular/src/lib/message-preview.ts b/projects/stream-chat-angular/src/lib/message-preview.ts index d97b4259..6e46c35b 100644 --- a/projects/stream-chat-angular/src/lib/message-preview.ts +++ b/projects/stream-chat-angular/src/lib/message-preview.ts @@ -1,17 +1,19 @@ -import { Attachment, MessageResponse, UserResponse } from 'stream-chat'; +import { + Attachment, + CustomMessageData, + MessageResponse, + UserResponse, +} from 'stream-chat'; import { v4 as uuidv4 } from 'uuid'; -import { DefaultStreamChatGenerics } from './types'; -export const createMessagePreview = < - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ->( +export const createMessagePreview = ( user: UserResponse, text: string, - attachments: Attachment[] = [], - mentionedUsers: UserResponse[] = [], + attachments: Attachment[] = [], + mentionedUsers: UserResponse[] = [], parentId: undefined | string = undefined, quotedMessageId: undefined | string = undefined, - customData: undefined | Partial + customData: undefined | CustomMessageData ) => { const clientSideId = `${user.id}-${uuidv4()}`; @@ -30,5 +32,5 @@ export const createMessagePreview = < parent_id: parentId, quoted_message_id: quotedMessageId, ...customData, - } as unknown as MessageResponse; + } as unknown as MessageResponse; }; diff --git a/projects/stream-chat-angular/src/lib/message-reactions-selector/message-reactions-selector.component.ts b/projects/stream-chat-angular/src/lib/message-reactions-selector/message-reactions-selector.component.ts index 3cecf3fb..f223994a 100644 --- a/projects/stream-chat-angular/src/lib/message-reactions-selector/message-reactions-selector.component.ts +++ b/projects/stream-chat-angular/src/lib/message-reactions-selector/message-reactions-selector.component.ts @@ -6,7 +6,7 @@ import { OnDestroy, OnInit, } from '@angular/core'; -import { DefaultStreamChatGenerics, MessageReactionType } from '../types'; +import { MessageReactionType } from '../types'; import { ReactionResponse } from 'stream-chat'; import { ChannelService } from '../channel.service'; import { MessageReactionsService } from '../message-reactions.service'; @@ -26,7 +26,7 @@ export class MessageReactionsSelectorComponent /** * List of the user's own reactions of a [message](/chat/docs/sdk/angular/types/stream-message/), used to display the users of a reaction type. */ - @Input() ownReactions: ReactionResponse[] = []; + @Input() ownReactions: ReactionResponse[] = []; /** * The id of the message the reactions belong to */ diff --git a/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts b/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts index 6267e063..559b8b4f 100644 --- a/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts +++ b/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts @@ -15,7 +15,7 @@ import { ReactionResponse, UserResponse, } from 'stream-chat'; -import { MessageReactionType, DefaultStreamChatGenerics } from '../types'; +import { MessageReactionType } from '../types'; import { MessageReactionsService } from '../message-reactions.service'; import { CustomTemplatesService } from '../custom-templates.service'; import { Subscription } from 'rxjs'; @@ -50,11 +50,11 @@ export class MessageReactionsComponent * List of reactions of a [message](/chat/docs/sdk/angular/types/stream-message/), used to display the users of a reaction type. * @deprecated you can fetch the reactions using [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/services/MessageReactionsService/#queryreactions) */ - @Input() latestReactions: ReactionResponse[] = []; + @Input() latestReactions: ReactionResponse[] = []; /** * List of the user's own reactions of a [message](/chat/docs/sdk/angular/types/stream-message/), used to display the users of a reaction type. */ - @Input() ownReactions: ReactionResponse[] = []; + @Input() ownReactions: ReactionResponse[] = []; @ViewChild('selectorContainer') private selectorContainer: | ElementRef | undefined; diff --git a/projects/stream-chat-angular/src/lib/message-text/message-text.component.ts b/projects/stream-chat-angular/src/lib/message-text/message-text.component.ts index ca33d506..ed599ba5 100644 --- a/projects/stream-chat-angular/src/lib/message-text/message-text.component.ts +++ b/projects/stream-chat-angular/src/lib/message-text/message-text.component.ts @@ -1,10 +1,6 @@ import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; -import { - DefaultStreamChatGenerics, - MentionTemplateContext, - StreamMessage, -} from '../types'; -import { MessageResponseBase, UserResponse } from 'stream-chat'; +import { MentionTemplateContext, StreamMessage } from '../types'; +import { UserResponse } from 'stream-chat'; import emojiRegex from 'emoji-regex'; import { MessageService } from '../message.service'; import { CustomTemplatesService } from '../custom-templates.service'; @@ -27,10 +23,7 @@ export class MessageTextComponent implements OnChanges { /** * The message which text should be displayed */ - @Input() message: - | StreamMessage - | undefined - | MessageResponseBase; + @Input() message: StreamMessage | undefined | StreamMessage['quoted_message']; /** * `true` if the component displayes a message quote */ diff --git a/projects/stream-chat-angular/src/lib/message.service.ts b/projects/stream-chat-angular/src/lib/message.service.ts index c0175d9d..5fe08edd 100644 --- a/projects/stream-chat-angular/src/lib/message.service.ts +++ b/projects/stream-chat-angular/src/lib/message.service.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { Attachment } from 'stream-chat'; -import { DefaultStreamChatGenerics } from './types'; /** * The message service contains configuration options related to displaying the message content @@ -8,9 +7,7 @@ import { DefaultStreamChatGenerics } from './types'; @Injectable({ providedIn: 'root', }) -export class MessageService< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> { +export class MessageService { /** * Decides if the message content should be formatted as text or HTML * @@ -33,7 +30,7 @@ export class MessageService< * * Provide a method which retruns `true` if an attachment should be considered as custom. */ - filterCustomAttachment?: (attachment: Attachment) => boolean; + filterCustomAttachment?: (attachment: Attachment) => boolean; constructor() {} @@ -42,7 +39,7 @@ export class MessageService< * @param attachment * @returns `true` if the attachment is custom */ - isCustomAttachment(attachment: Attachment) { + isCustomAttachment(attachment: Attachment) { if (this.filterCustomAttachment) { return this.filterCustomAttachment(attachment); } else { diff --git a/projects/stream-chat-angular/src/lib/message/message.component.spec.ts b/projects/stream-chat-angular/src/lib/message/message.component.spec.ts index f9ea11b9..c5897225 100644 --- a/projects/stream-chat-angular/src/lib/message/message.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/message/message.component.spec.ts @@ -6,7 +6,7 @@ import { } from '@angular/core/testing'; import { MessageResponseBase, UserResponse } from 'stream-chat'; -import { DefaultStreamChatGenerics, StreamMessage } from '../types'; +import { StreamMessage } from '../types'; import { LoadingIndicatorComponent } from '../icon/loading-indicator/loading-indicator.component'; import { MessageComponent } from './message.component'; import { AvatarComponent } from '../avatar/avatar.component'; @@ -31,7 +31,7 @@ describe('MessageComponent', () => { let fixture: ComponentFixture; let nativeElement: HTMLElement; let message: StreamMessage; - let currentUser: UserResponse; + let currentUser: UserResponse; let queryContainer: () => HTMLElement | null; let querySender: () => HTMLElement | null; let queryDate: () => HTMLElement | null; @@ -869,7 +869,7 @@ describe('MessageComponent', () => { describe('quoted message', () => { const quotedMessageContainerSelector = '[data-testid="quoted-message-container"]'; - let quotedMessage: StreamMessage; + let quotedMessage: StreamMessage; beforeEach(() => { quotedMessage = mockMessage(); @@ -879,12 +879,11 @@ describe('MessageComponent', () => { name: 'Sara', image: 'http://url/to/img', }; - quotedMessage.attachments = [{ id: '1' }, { id: '2' }]; + quotedMessage.attachments = [{ image_url: '1' }, { image_url: '2' }]; quotedMessage.text = 'This message was quoted'; component.message = { ...component.message!, - quoted_message: - quotedMessage as any as MessageResponseBase, + quoted_message: quotedMessage as any as MessageResponseBase, }; component.ngOnChanges({ message: {} as SimpleChange }); fixture.detectChanges(); @@ -911,7 +910,7 @@ describe('MessageComponent', () => { expect(avatar.type).toBe('user'); expect(avatar.location).toBe('quoted-message-sender'); expect(avatar.user).toBe(component.message!.quoted_message!.user!); - expect(attachments.attachments).toEqual([{ id: '1' }]); + expect(attachments.attachments).toEqual([{ image_url: '1' }]); expect( nativeElement.querySelector('[data-testid="quoted-message-text"]') ?.innerHTML diff --git a/projects/stream-chat-angular/src/lib/message/message.component.ts b/projects/stream-chat-angular/src/lib/message/message.component.ts index 787bf2bc..f08b97c6 100644 --- a/projects/stream-chat-angular/src/lib/message/message.component.ts +++ b/projects/stream-chat-angular/src/lib/message/message.component.ts @@ -19,7 +19,6 @@ import { AttachmentListContext, MessageActionsBoxContext, MessageReactionsContext, - DefaultStreamChatGenerics, StreamMessage, DeliveredStatusContext, SendingStatusContext, @@ -85,7 +84,7 @@ export class MessageComponent shouldDisplayThreadLink = false; isSentByCurrentUser = false; readByText = ''; - lastReadUser: UserResponse | undefined = undefined; + lastReadUser: UserResponse | undefined = undefined; isOnlyReadByMe = false; isReadByMultipleUsers = false; isMessageDeliveredAndRead = false; diff --git a/projects/stream-chat-angular/src/lib/mocks/index.ts b/projects/stream-chat-angular/src/lib/mocks/index.ts index 927b3c17..afb82b50 100644 --- a/projects/stream-chat-angular/src/lib/mocks/index.ts +++ b/projects/stream-chat-angular/src/lib/mocks/index.ts @@ -1,8 +1,4 @@ -import { - ChannelQueryState, - DefaultStreamChatGenerics, - StreamMessage, -} from '../types'; +import { ChannelQueryState, StreamMessage } from '../types'; import { BehaviorSubject, ReplaySubject, Subject } from 'rxjs'; import { AppSettings, @@ -20,7 +16,7 @@ export const mockCurrentUser = () => name: 'Bob', image: 'link/to/photo', total_unread_count: 0, - } as UserResponse); + } as UserResponse); export const mockMessage = (id?: number) => ({ @@ -49,7 +45,7 @@ export const generateMockMessages = (offset = 0, isOlder = false) => { return messages; }; -export type MockChannel = Channel & { +export type MockChannel = Channel & { handleEvent: ( name: EventTypes | 'capabilities.changed', payload?: any @@ -224,9 +220,9 @@ export const generateMockChannel = (type: string, id: string) => { export type MockChannelService = { hasMoreChannels$: Subject; - channels$: Subject[] | undefined>; + channels$: Subject; activeChannelMessages$: BehaviorSubject; - activeChannel$: Subject>; + activeChannel$: Subject; activeThreadMessages$: BehaviorSubject; activeParentMessageId$: BehaviorSubject; activeParentMessage$: BehaviorSubject; @@ -236,7 +232,7 @@ export type MockChannelService = { channelQueryState$: BehaviorSubject; activeChannelLastReadMessageId?: string; activeChannelUnreadCount?: number; - activeChannel?: Channel; + activeChannel?: Channel; activeChannelMessages: StreamMessage[]; activeChannelThreadReplies: StreamMessage[]; loadMoreMessages: ( @@ -267,12 +263,8 @@ export const mockChannelService = (): MockChannelService => { activeChannel.state.messages = messages; activeChannel.state.latestMessages = messages; const activeChannelMessages = messages; - const activeChannel$ = new BehaviorSubject< - Channel - >(activeChannel); - const channels$ = new BehaviorSubject< - Channel[] | undefined - >(undefined); + const activeChannel$ = new BehaviorSubject(activeChannel); + const channels$ = new BehaviorSubject(undefined); const hasMoreChannels$ = new ReplaySubject(1); const jumpToMessage$ = new BehaviorSubject<{ id?: string; diff --git a/projects/stream-chat-angular/src/lib/read-by.spec.ts b/projects/stream-chat-angular/src/lib/read-by.spec.ts index cd156e46..ef12eaa9 100644 --- a/projects/stream-chat-angular/src/lib/read-by.spec.ts +++ b/projects/stream-chat-angular/src/lib/read-by.spec.ts @@ -1,6 +1,5 @@ import { Channel, FormatMessageResponse } from 'stream-chat'; import { getReadBy } from './read-by'; -import { DefaultStreamChatGenerics } from './types'; describe('getReadBy', () => { it('should return the users that have already read the provided #message', () => { @@ -9,10 +8,10 @@ describe('getReadBy', () => { const message = { created_at: new Date('2021-09-14T13:08:30.004112Z'), user: sender, - } as FormatMessageResponse; + } as FormatMessageResponse; const channel = { state: { read: {} }, - } as Channel; + } as Channel; expect(getReadBy(message, channel).length).toBe(0); diff --git a/projects/stream-chat-angular/src/lib/read-by.ts b/projects/stream-chat-angular/src/lib/read-by.ts index 41a6763a..1a6d170c 100644 --- a/projects/stream-chat-angular/src/lib/read-by.ts +++ b/projects/stream-chat-angular/src/lib/read-by.ts @@ -1,12 +1,6 @@ import { Channel, FormatMessageResponse, UserResponse } from 'stream-chat'; -import { DefaultStreamChatGenerics } from './types'; -export const getReadBy = < - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ->( - message: FormatMessageResponse, - channel: Channel -) => { +export const getReadBy = (message: FormatMessageResponse, channel: Channel) => { const readBy: UserResponse[] = []; Object.keys(channel.state.read).forEach((key) => { if ( diff --git a/projects/stream-chat-angular/src/lib/thread/thread.component.spec.ts b/projects/stream-chat-angular/src/lib/thread/thread.component.spec.ts index d3c8c6bb..74c975ec 100644 --- a/projects/stream-chat-angular/src/lib/thread/thread.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/thread/thread.component.spec.ts @@ -10,7 +10,6 @@ import { MockChannelService, mockMessage, } from '../mocks'; -import { DefaultStreamChatGenerics } from '../types'; import { ThreadComponent } from './thread.component'; @@ -18,7 +17,7 @@ describe('ThreadComponent', () => { let fixture: ComponentFixture; let queryCloseButton: () => HTMLElement | null; let channelServiceMock: MockChannelService; - let channel: Channel; + let channel: Channel; beforeEach(async () => { channelServiceMock = mockChannelService(); @@ -41,7 +40,7 @@ describe('ThreadComponent', () => { const nativeElement = fixture.nativeElement as HTMLElement; queryCloseButton = () => nativeElement.querySelector('[data-testid="close-button"]'); - channel = generateMockChannels()[0] as Channel; + channel = generateMockChannels()[0] as Channel; channelServiceMock.activeChannel$.next(channel); fixture.detectChanges(); }); diff --git a/projects/stream-chat-angular/src/lib/thread/thread.component.ts b/projects/stream-chat-angular/src/lib/thread/thread.component.ts index c930186b..1de0b14a 100644 --- a/projects/stream-chat-angular/src/lib/thread/thread.component.ts +++ b/projects/stream-chat-angular/src/lib/thread/thread.component.ts @@ -5,11 +5,7 @@ import { ChatClientService } from '../chat-client.service'; import { ChannelService } from '../channel.service'; import { CustomTemplatesService } from '../custom-templates.service'; import { getChannelDisplayText } from '../get-channel-display-text'; -import { - DefaultStreamChatGenerics, - StreamMessage, - ThreadHeaderContext, -} from '../types'; +import { StreamMessage, ThreadHeaderContext } from '../types'; /** * The `Thread` component represents a [message thread](/chat/docs/javascript/threads/), it is a container component that displays a thread with a header, [`MessageList`](/chat/docs/sdk/angular/components/MessageListComponent) and [`MessageInput`](/chat/docs/sdk/angular/components/MessageInputComponent/) components. @@ -22,7 +18,7 @@ import { export class ThreadComponent implements OnDestroy { @HostBinding('class') private class = 'str-chat__thread'; parentMessage: StreamMessage | undefined; - channel: Channel | undefined; + channel: Channel | undefined; private subscriptions: Subscription[] = []; constructor( diff --git a/projects/stream-chat-angular/src/lib/types.ts b/projects/stream-chat-angular/src/lib/types.ts index 6b53514e..f67fcedc 100644 --- a/projects/stream-chat-angular/src/lib/types.ts +++ b/projects/stream-chat-angular/src/lib/types.ts @@ -6,12 +6,9 @@ import type { ChannelFilters, ChannelMemberResponse, CommandResponse, - Event, - ExtendableGenerics, + CustomMessageData, FormatMessageResponse, - LiteralStringForUnion, MessageResponseBase, - Mute, ReactionGroupResponse, ReactionResponse, User, @@ -29,65 +26,19 @@ export type CustomTrigger = { }; }; -export type DefaultStreamChatGenerics = ExtendableGenerics & { - attachmentType: DefaultAttachmentType; - channelType: DefaultChannelType; - commandType: LiteralStringForUnion; - eventType: UnknownType; - messageType: DefaultMessageType; - reactionType: UnknownType; - userType: DefaultUserType; -}; - -export type DefaultAttachmentType = UnknownType & { - asset_url?: string; - id?: string; - images?: Array>; - mime_type?: string; - isCustomAttachment?: boolean; -}; - -export type DefaultChannelType = UnknownType & { - image?: string; - member_count?: number; - subtitle?: string; -}; - -export type DefaultCommandType = LiteralStringForUnion; - -export type DefaultMessageType = UnknownType & { - customType?: 'channel.intro' | 'message.date'; - date?: string | Date; - errorStatusCode?: number; - event?: Event; - unread?: boolean; - readBy: UserResponse[]; +export type StreamMessage = FormatMessageResponse & { + readBy: UserResponse[]; translation?: string; - quoted_message?: MessageResponseBase; -}; - -export type DefaultUserTypeInternal = { - image?: string; - status?: string; + errorStatusCode?: number; + quoted_message?: MessageResponseBase & { translation?: string }; }; -export type DefaultUserType = UnknownType & - DefaultUserTypeInternal & { - mutes?: Array>; - }; - -export type StreamMessage< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = FormatMessageResponse; - export type AttachmentUploadErrorReason = | 'file-size' | 'file-extension' | 'unknown'; -export type AttachmentUpload< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { +export type AttachmentUpload = { file: File; state: 'error' | 'success' | 'uploading'; errorReason?: AttachmentUploadErrorReason; @@ -96,8 +47,8 @@ export type AttachmentUpload< type: 'image' | 'file' | 'video' | 'voiceRecording'; previewUri?: string | ArrayBuffer; thumb_url?: string; - extraData?: Partial>; - fromAttachment?: Attachment; + extraData?: Partial; + fromAttachment?: Attachment; }; export type MentionAutcompleteListItemContext = { @@ -131,16 +82,12 @@ export type NotificationPayload = { dismissFn: () => void; }; -export type ChannelPreviewContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { - channel: Channel; +export type ChannelPreviewContext = { + channel: Channel; }; -export type ChannelPreviewInfoContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = ChannelPreviewContext & { - latestMessage?: StreamMessage; +export type ChannelPreviewInfoContext = ChannelPreviewContext & { + latestMessage?: StreamMessage; /** * The text of the latest message, or some meta information (for example: "Nothing yet") */ @@ -170,7 +117,7 @@ export type EmojiPickerContext = { }; export type TypingIndicatorContext = { - usersTyping$: Observable[]>; + usersTyping$: Observable; }; export type MessageContext = { @@ -183,15 +130,11 @@ export type MessageContext = { scroll$?: Observable; }; -export type ChannelActionsContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { channel: Channel }; +export type ChannelActionsContext = { channel: Channel }; -export type CustomAttachmentListContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { +export type CustomAttachmentListContext = { messageId: string; - attachments: Attachment[]; + attachments: Attachment[]; parentMessageId?: string; }; @@ -219,8 +162,8 @@ export type AvatarContext = { imageUrl: string | undefined; type: AvatarType | undefined; location: AvatarLocation | undefined; - channel?: Channel; - user?: User; + channel?: Channel; + user?: User; initialsType?: 'first-letter-of-first-word' | 'first-letter-of-each-word'; showOnlineIndicator?: boolean; }; @@ -236,11 +179,9 @@ export type IconContext = { icon: Icon | undefined; }; -export type MessageActionsBoxContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { +export type MessageActionsBoxContext = { isMine: boolean; - message: StreamMessage | undefined; + message: StreamMessage | undefined; enabledActions: string[]; messageTextHtmlElement: HTMLElement | undefined; }; @@ -250,49 +191,39 @@ export type MessageActionHandlerExtraParams = { messageTextHtmlElement?: HTMLElement; }; -export type MessageActionHandler< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = ( - message: StreamMessage, +export type MessageActionHandler = ( + message: StreamMessage, params: MessageActionHandlerExtraParams ) => void; -export type MessageActionBoxItemContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { +export type MessageActionBoxItemContext = { actionName: string; - actionLabelOrTranslationKey: ((message: StreamMessage) => string) | string; - message: StreamMessage; + actionLabelOrTranslationKey: ((message: StreamMessage) => string) | string; + message: StreamMessage; actionHandlerExtraParams: MessageActionHandlerExtraParams; - actionHandler: MessageActionHandler; + actionHandler: MessageActionHandler; }; -export type MessageReactionActionItem< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { +export type MessageReactionActionItem = { actionName: 'react'; isVisible: ( enabledActions: string[], isMine: boolean, - message: StreamMessage + message: StreamMessage ) => boolean; }; -type MessageActionItemBase< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { - actionLabelOrTranslationKey: ((message: StreamMessage) => string) | string; +type MessageActionItemBase = { + actionLabelOrTranslationKey: ((message: StreamMessage) => string) | string; isVisible: ( enabledActions: string[], isMine: boolean, - message: StreamMessage + message: StreamMessage ) => boolean; actionHandler: MessageActionHandler; }; -export type MessageActionItem< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = MessageActionItemBase & { +export type MessageActionItem = MessageActionItemBase & { actionName: | 'quote' | 'pin' @@ -304,15 +235,13 @@ export type MessageActionItem< | 'copy-message-text'; }; -export type CustomMessageActionItem< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = MessageActionItemBase & { +export type CustomMessageActionItem = MessageActionItemBase & { actionName: string; }; export type MessageReactionsSelectorContext = { messageId: string | undefined; - ownReactions: ReactionResponse[]; + ownReactions: ReactionResponse[]; }; export type MessageReactionsContext = { @@ -320,8 +249,8 @@ export type MessageReactionsContext = { /** @deprecated use `messageReactionGroups` */ messageReactionCounts: { [key in MessageReactionType]?: number }; /** @deprecated you can fetch the reactions using [`chatService.chatClient.queryReactions()`](/chat/docs/javascript/send_reaction/&q=queryReactions#query-reactions) */ - latestReactions: ReactionResponse[]; - ownReactions: ReactionResponse[]; + latestReactions: ReactionResponse[]; + ownReactions: ReactionResponse[]; messageReactionGroups: { [key in MessageReactionType]: ReactionGroupResponse; }; @@ -368,10 +297,8 @@ export type SendingStatusContext = { message: StreamMessage; }; -export type CustomMetadataContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { - message: StreamMessage; +export type CustomMetadataContext = { + message: StreamMessage; }; export type ReadStatusContext = { @@ -379,9 +306,7 @@ export type ReadStatusContext = { readByText: string; }; -export type ChannelHeaderInfoContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { channel: Channel }; +export type ChannelHeaderInfoContext = { channel: Channel }; export type CustomAttachmentUploadContext = { isMultipleFileUploadEnabled: boolean | undefined; @@ -389,7 +314,11 @@ export type CustomAttachmentUploadContext = { }; export type AttachmentContext = { - attachment: Attachment; + attachment: Attachment; +}; + +export type GalleryAttachmentContext = { + attachment: GalleryAttachment; }; export type SystemMessageContext = MessageContext & { @@ -417,15 +346,13 @@ export type ChannelQueryState = { error?: unknown; }; -export type MessageInput< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { +export type MessageInput = { text: string; - attachments: Attachment[]; - mentionedUsers: UserResponse[]; + attachments: Attachment[]; + mentionedUsers: UserResponse[]; parentId: string | undefined; quotedMessageId: string | undefined; - customData: undefined | Partial; + customData: undefined | CustomMessageData; }; export type OffsetNextPageConfiguration = { @@ -433,11 +360,9 @@ export type OffsetNextPageConfiguration = { offset: number; }; -export type FiltertNextPageConfiguration< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { +export type FiltertNextPageConfiguration = { type: 'filter'; - paginationFilter: ChannelFilters; + paginationFilter: ChannelFilters; }; export type NextPageConfiguration = @@ -450,9 +375,9 @@ export type MessageReactionClickDetails = { reactionType: string; }; -export type MessageActionsClickDetails< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = MessageActionsBoxContext & { customActions: CustomMessageActionItem[] }; +export type MessageActionsClickDetails = MessageActionsBoxContext & { + customActions: CustomMessageActionItem[]; +}; export type GroupStyleOptions = { noGroupByUser?: boolean; @@ -462,10 +387,8 @@ export type GroupStyleOptions = { export type ChannelQueryType = 'first-page' | 'next-page' | 'recover-state'; -export type ChannelQueryResult< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { - channels: Channel[]; +export type ChannelQueryResult = { + channels: Channel[]; hasMorePage: boolean; }; @@ -489,16 +412,12 @@ export type MediaRecording = { asset_url: string | ArrayBuffer | undefined; }; -export type CustomAttachmentPreviewListContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { - attachmentService: AttachmentService; +export type CustomAttachmentPreviewListContext = { + attachmentService: AttachmentService; }; -export type ThreadReplyButtonContext< - T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics -> = { - message: StreamMessage; +export type ThreadReplyButtonContext = { + message: StreamMessage; }; export type CustomAutocompleteItemContext = { @@ -546,3 +465,8 @@ export type MessageTextContext = { isQuoted: boolean; shouldTranslate: boolean; }; + +export type GalleryAttachment = { + type: 'gallery'; + images: Attachment[]; +}; diff --git a/projects/stream-chat-angular/src/lib/user-list/user-list.component.ts b/projects/stream-chat-angular/src/lib/user-list/user-list.component.ts index e174e717..d09ea84c 100644 --- a/projects/stream-chat-angular/src/lib/user-list/user-list.component.ts +++ b/projects/stream-chat-angular/src/lib/user-list/user-list.component.ts @@ -1,6 +1,5 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { UserResponse } from 'stream-chat'; -import { DefaultStreamChatGenerics } from '../types'; /** * The `UserListComponent` can display a list of Stream users with pagination @@ -14,7 +13,7 @@ export class UserListComponent { /** * The users to display */ - @Input() users: UserResponse[] = []; + @Input() users: UserResponse[] = []; /** * If `true`, the loading indicator will be displayed */ diff --git a/projects/stream-chat-angular/src/lib/voice-recording/voice-recording.component.ts b/projects/stream-chat-angular/src/lib/voice-recording/voice-recording.component.ts index d7e66205..e1f70b10 100644 --- a/projects/stream-chat-angular/src/lib/voice-recording/voice-recording.component.ts +++ b/projects/stream-chat-angular/src/lib/voice-recording/voice-recording.component.ts @@ -10,7 +10,6 @@ import { ViewChild, } from '@angular/core'; import { Attachment } from 'stream-chat'; -import { DefaultStreamChatGenerics } from '../types'; import prettybytes from 'pretty-bytes'; import { formatDuration } from '../format-duration'; @@ -26,7 +25,7 @@ export class VoiceRecordingComponent implements OnChanges, AfterViewInit { /** * The voice recording attachment */ - @Input() attachment?: Attachment; + @Input() attachment?: Attachment; fileSize: string = ''; secondsElapsedFormatted: string; durationFormatted: string = ''; diff --git a/projects/stream-chat-angular/src/public-api.ts b/projects/stream-chat-angular/src/public-api.ts index 5644d4eb..3cd6cb60 100644 --- a/projects/stream-chat-angular/src/public-api.ts +++ b/projects/stream-chat-angular/src/public-api.ts @@ -1,7 +1,27 @@ +declare module 'stream-chat' { + interface CustomUserData { + image?: string; + } + interface CustomAttachmentData { + /** + * @deprecated Please use `image_url` instead + */ + img_url?: string; + /** + * Will be `true` if an attachment was added using `attachmentService.addAttachment` + * + * This is a non-standard property, other SDKs will ignore this property + */ + isCustomAttachment?: boolean; + } + + interface CustomChannelData { + image?: string; + } +} /* * Public API Surface of stream-chat-angular */ - export * from './lib/chat-client.service'; export * from './lib/channel.service'; export * from './lib/theme.service'; diff --git a/projects/stream-chat-angular/tsconfig.spec.json b/projects/stream-chat-angular/tsconfig.spec.json index fafd1e12..1cf009e9 100644 --- a/projects/stream-chat-angular/tsconfig.spec.json +++ b/projects/stream-chat-angular/tsconfig.spec.json @@ -5,6 +5,6 @@ "outDir": "../../out-tsc/spec", "types": ["jasmine"] }, - "files": ["src/test.ts"], + "files": ["src/test.ts", "src/public-api.ts"], "include": ["**/*.spec.ts", "**/*.d.ts"] } From 1b745fec63a47e243dae700e18b9f74870fe190d Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Wed, 5 Mar 2025 16:36:27 +0100 Subject: [PATCH 03/17] chore: use image_url instead of img_url in tests (as img_url is deprecated) --- .../attachment-configuration.service.spec.ts | 10 ++-- .../attachment-list.component.spec.ts | 58 +++++++++---------- .../message-input.component.spec.ts | 2 +- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/projects/stream-chat-angular/src/lib/attachment-configuration.service.spec.ts b/projects/stream-chat-angular/src/lib/attachment-configuration.service.spec.ts index 7ce62b87..533be094 100644 --- a/projects/stream-chat-angular/src/lib/attachment-configuration.service.spec.ts +++ b/projects/stream-chat-angular/src/lib/attachment-configuration.service.spec.ts @@ -70,7 +70,7 @@ describe('AttachmentConfigurationService', () => { const spy = jasmine.createSpy(); service.customImageAttachmentConfigurationHandler = spy; const attachment: Attachment = { - img_url: 'http://url/to/img', + image_url: 'http://url/to/img', thumb_url: 'different/url', }; const htmlElement = { @@ -88,7 +88,7 @@ describe('AttachmentConfigurationService', () => { it('should provide the correct configuration for gallery image attachments', () => { const attachment: Attachment = { - img_url: 'http://url/to/img', + image_url: 'http://url/to/img', }; const htmlElement = { 'max-width': '300px', @@ -112,7 +112,7 @@ describe('AttachmentConfigurationService', () => { it('should provide the correct configuration for image attachments inside the carousel', () => { const attachment: Attachment = { - img_url: 'http://url/to/img', + image_url: 'http://url/to/img', }; const htmlElement = { 'max-width': 'none', @@ -191,7 +191,7 @@ describe('AttachmentConfigurationService', () => { const spy = jasmine.createSpy(); service.customVideoAttachmentConfigurationHandler = spy; const attachment: Attachment = { - img_url: 'http://url/to/video', + image_url: 'http://url/to/video', thumb_url: 'different/url', }; const htmlElement = { @@ -348,7 +348,7 @@ describe('AttachmentConfigurationService', () => { it('should provide integer values for image resize and make sure that each dimension is at least the size restriction', () => { const attachment = { - img_url: 'http://url/to/img?ow=3534&oh=4417', + image_url: 'http://url/to/img?ow=3534&oh=4417', }; const htmlElement = { 'max-width': '300px', diff --git a/projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.spec.ts b/projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.spec.ts index b07f1a4e..9efee557 100644 --- a/projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.spec.ts @@ -142,7 +142,7 @@ describe('AttachmentListComponent', () => { expect(queryAttachments().length).toBe(0); component.attachments = [ - { type: 'image', img_url: 'http://url1' }, + { type: 'image', image_url: 'http://url1' }, { type: 'file', asset_url: 'http://url3' }, { type: 'video', @@ -264,9 +264,9 @@ describe('AttachmentListComponent', () => { it('should create gallery', () => { component.attachments = [ - { type: 'image', img_url: 'http://url1' }, + { type: 'image', image_url: 'http://url1' }, { type: 'file', asset_url: 'http://url3' }, - { type: 'image', img_url: 'http://url2' }, + { type: 'image', image_url: 'http://url2' }, ]; component.ngOnChanges({ attachments: {} as SimpleChange }); fixture.detectChanges(); @@ -274,18 +274,18 @@ describe('AttachmentListComponent', () => { expect(orderedAttachments.length).toBe(2); expect(orderedAttachments[0].type).toBe('gallery'); - expect((orderedAttachments[0] as GalleryAttachment).images[0].img_url).toBe( - 'http://url1' - ); - expect((orderedAttachments[0] as GalleryAttachment).images[1].img_url).toBe( - 'http://url2' - ); + expect( + (orderedAttachments[0] as GalleryAttachment).images[0].image_url + ).toBe('http://url1'); + expect( + (orderedAttachments[0] as GalleryAttachment).images[1].image_url + ).toBe('http://url2'); }); it('should display gallery', () => { component.attachments = [ - { type: 'image', img_url: 'http://url1' }, - { type: 'image', img_url: 'http://url2' }, + { type: 'image', image_url: 'http://url1' }, + { type: 'image', image_url: 'http://url2' }, ]; component.ngOnChanges({ attachments: {} as SimpleChange }); fixture.detectChanges(); @@ -300,8 +300,8 @@ describe('AttachmentListComponent', () => { ).toBeNull(); component.attachments = [ - { type: 'image', img_url: 'http://url1' }, - { type: 'image', img_url: 'http://url2' }, + { type: 'image', image_url: 'http://url1' }, + { type: 'image', image_url: 'http://url2' }, { type: 'image', thumb_url: 'http://url3' }, { type: 'image', image_url: 'http://url4' }, ]; @@ -320,8 +320,8 @@ describe('AttachmentListComponent', () => { ).not.toBeNull(); component.attachments = [ - { type: 'image', img_url: 'http://url1' }, - { type: 'image', img_url: 'http://url2' }, + { type: 'image', image_url: 'http://url1' }, + { type: 'image', image_url: 'http://url2' }, { type: 'image', thumb_url: 'http://url3' }, { type: 'image', image_url: 'http://url4' }, { type: 'image', image_url: 'http://url5' }, @@ -471,7 +471,7 @@ describe('AttachmentListComponent', () => { it('should display image by thumb_url', () => { const thumbUrl = 'http://thumb/url'; component.attachments = [ - { type: 'image', img_url: undefined, thumb_url: thumbUrl }, + { type: 'image', image_url: undefined, thumb_url: thumbUrl }, ]; component.ngOnChanges({ attachments: {} as SimpleChange }); fixture.detectChanges(); @@ -498,7 +498,7 @@ describe('AttachmentListComponent', () => { it('should set alt text for image', () => { const fallback = 'Fallback is image can not be displayed'; component.attachments = [ - { type: 'image', img_url: 'http://url1', fallback }, + { type: 'image', image_url: 'http://url1', fallback }, ]; component.ngOnChanges({ attachments: {} as SimpleChange }); fixture.detectChanges(); @@ -508,7 +508,7 @@ describe('AttachmentListComponent', () => { it('should display add necessary CSS class for SVG images', () => { component.attachments = [ - { type: 'image', img_url: 'http://image/url', fallback: 'image.svg' }, + { type: 'image', image_url: 'http://image/url', fallback: 'image.svg' }, ]; component.ngOnChanges({ attachments: {} as SimpleChange }); fixture.detectChanges(); @@ -518,7 +518,7 @@ describe('AttachmentListComponent', () => { ).not.toBeNull(); component.attachments = [ - { type: 'image', img_url: 'http://image/url', fallback: 'image.jpg' }, + { type: 'image', image_url: 'http://image/url', fallback: 'image.jpg' }, ]; component.ngOnChanges({ attachments: {} as SimpleChange }); fixture.detectChanges(); @@ -797,7 +797,7 @@ describe('AttachmentListComponent', () => { }, { type: 'image', - img_url: 'http://url2', + image_url: 'http://url2', }, ]; component.attachments = attachments; @@ -826,7 +826,7 @@ describe('AttachmentListComponent', () => { }, { type: 'image', - img_url: 'http://url2', + image_url: 'http://url2', }, ]; component.attachments = attachments; @@ -855,7 +855,7 @@ describe('AttachmentListComponent', () => { }, { type: 'image', - img_url: 'http://url2', + image_url: 'http://url2', }, { type: 'image', @@ -879,7 +879,7 @@ describe('AttachmentListComponent', () => { queryImageModalNextButton()?.click(); fixture.detectChanges(); - expect(queryImageModalImage()?.src).toContain(attachments[1].img_url!); + expect(queryImageModalImage()?.src).toContain(attachments[1].image_url!); expect(queryImageModalPrevButton()?.style.visibility).toBe('visible'); expect(queryImageModalNextButton()?.style.visibility).toBe('visible'); @@ -964,7 +964,7 @@ describe('AttachmentListComponent', () => { // Single image, link image, video, giphy component.attachments = [ - { type: 'image', img_url: 'http://url1' }, + { type: 'image', image_url: 'http://url1' }, { title: 'BBC - Homepage', title_link: 'https://www.bbc.com/', @@ -1016,11 +1016,11 @@ describe('AttachmentListComponent', () => { // Gallery component.attachments = [ - { type: 'image', img_url: 'http://url1' }, - { type: 'image', img_url: 'http://url2' }, - { type: 'image', img_url: 'http://url3' }, - { type: 'image', img_url: 'http://url4' }, - { type: 'image', img_url: 'http://url5' }, + { type: 'image', image_url: 'http://url1' }, + { type: 'image', image_url: 'http://url2' }, + { type: 'image', image_url: 'http://url3' }, + { type: 'image', image_url: 'http://url4' }, + { type: 'image', image_url: 'http://url5' }, ]; component.ngOnChanges({ attachments: {} as SimpleChange }); fixture.detectChanges(); diff --git a/projects/stream-chat-angular/src/lib/message-input/message-input.component.spec.ts b/projects/stream-chat-angular/src/lib/message-input/message-input.component.spec.ts index 669e8c9e..69af6ad3 100644 --- a/projects/stream-chat-angular/src/lib/message-input/message-input.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/message-input/message-input.component.spec.ts @@ -576,7 +576,7 @@ describe('MessageInputComponent', () => { attachmentService.mapToAttachments.and.returnValue([ { type: 'image', - img_url: 'url', + image_url: 'url', }, ]); const textarea = queryTextarea(); From 17bc676afc171931dfe05abe9e80e483b0096d64 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Wed, 5 Mar 2025 16:38:39 +0100 Subject: [PATCH 04/17] feat: add support for @ngx-translate/core@16 --- projects/stream-chat-angular/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index 03b4f329..730f0498 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -20,7 +20,7 @@ "@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "@breezystack/lamejs": "^1.2.7", - "@ngx-translate/core": "^14.0.0 || ^15.0.0", + "@ngx-translate/core": "^14.0.0 || ^15.0.0 || ^16.0.0", "rxjs": "^7.4.0", "stream-chat": "9.0.0-rc.5" }, From bdc789091c5bc4e7033e4874df526cb6307b311c Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 7 Mar 2025 14:28:46 +0100 Subject: [PATCH 05/17] fix: remove stream-chat module augmentation from stream-chat-angular --- package-lock.json | 699 +++++++++++++++--- package.json | 15 +- .../src/app/app.component.html | 2 +- .../src/app/stream-chat.d.ts | 7 + projects/stream-chat-angular/package.json | 2 +- projects/stream-chat-angular/src/lib/types.ts | 17 + .../stream-chat-angular/src/public-api.ts | 23 +- .../stream-chat-angular/src/stream-chat.ts | 8 + projects/stream-chat-angular/src/test.ts | 3 +- .../stream-chat-angular/tsconfig.spec.json | 2 +- 10 files changed, 639 insertions(+), 139 deletions(-) create mode 100644 projects/customizations-example/src/app/stream-chat.d.ts create mode 100644 projects/stream-chat-angular/src/stream-chat.ts diff --git a/package-lock.json b/package-lock.json index 6111606b..48727a96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,10 +29,12 @@ "emoji-regex": "^10.3.0", "fix-webm-duration": "^1.0.6", "ngx-float-ui": "^15.0.0", + "npm-watch": "^0.13.0", "pretty-bytes": "^6.1.1", + "replace": "^1.2.2", "rxjs": "~7.4.0", "starwars-names": "^1.6.0", - "stream-chat": "9.0.0-rc.5", + "stream-chat": "9.0.0-rc.6", "ts-node": "^10.9.2", "tslib": "^2.3.0", "uuid": "^9.0.1", @@ -7826,7 +7828,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -7862,7 +7863,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -8166,8 +8166,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base64-arraybuffer": { "version": "0.1.4", @@ -8231,7 +8230,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, "engines": { "node": ">=8" } @@ -8333,7 +8331,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8343,7 +8340,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -8563,7 +8559,6 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, "engines": { "node": ">=6" } @@ -8623,7 +8618,6 @@ "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, "funding": [ { "type": "individual", @@ -9007,8 +9001,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "node_modules/config-chain": { "version": "1.1.13", @@ -9567,7 +9560,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -9580,6 +9572,15 @@ } } }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/deep-equal": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", @@ -10803,7 +10804,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -11619,7 +11619,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -11681,7 +11680,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -11926,7 +11924,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -12013,7 +12010,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -12151,7 +12147,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -12703,6 +12698,12 @@ "node": ">= 4" } }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "license": "ISC" + }, "node_modules/ignore-walk": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.4.tgz", @@ -12846,8 +12847,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { "version": "3.0.1", @@ -13014,7 +13014,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -13111,7 +13110,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -13120,7 +13118,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -13129,7 +13126,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -13174,7 +13170,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -14173,7 +14168,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -14952,7 +14946,6 @@ "version": "3.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -15522,6 +15515,67 @@ "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, + "node_modules/nodemon": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", + "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/nodemon/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/noms": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", @@ -15607,7 +15661,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -16094,6 +16147,19 @@ "node": ">=8" } }, + "node_modules/npm-watch": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/npm-watch/-/npm-watch-0.13.0.tgz", + "integrity": "sha512-MYcgocqCzYA44feZhFoYj69FfSaO0EeRE1gcRcmPaXIpNhUMAhNJ1pwic2C4Hn0OPOQmZKSl90CPgmwvOsVhTg==", + "license": "MIT", + "dependencies": { + "nodemon": "^3.0.1", + "through2": "^4.0.2" + }, + "bin": { + "npm-watch": "cli.js" + } + }, "node_modules/npm/node_modules/@isaacs/cliui": { "version": "8.0.2", "dev": true, @@ -18750,7 +18816,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, "dependencies": { "p-try": "^2.0.0" }, @@ -18765,7 +18830,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -18829,7 +18893,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, "engines": { "node": ">=6" } @@ -19053,7 +19116,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "engines": { "node": ">=8" } @@ -19191,7 +19253,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -20033,6 +20094,12 @@ "dev": true, "optional": true }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "license": "MIT" + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -20377,7 +20444,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -20391,7 +20457,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -20524,11 +20589,189 @@ "jsesc": "bin/jsesc" } }, + "node_modules/replace": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/replace/-/replace-1.2.2.tgz", + "integrity": "sha512-C4EDifm22XZM2b2JOYe6Mhn+lBsLBAvLbK8drfUQLTfD1KYl/n3VaW/CDju0Ny4w3xTtegBpg8YNSpFJPUDSjA==", + "license": "MIT", + "dependencies": { + "chalk": "2.4.2", + "minimatch": "3.0.5", + "yargs": "^15.3.1" + }, + "bin": { + "replace": "bin/replace.js", + "search": "bin/search.js" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/replace/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/replace/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/replace/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/replace/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/replace/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/replace/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/replace/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/replace/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/replace/node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/replace/node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/replace/node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/replace/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "node_modules/replace/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/replace/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -20542,6 +20785,12 @@ "node": ">=0.10.0" } }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "license": "ISC" + }, "node_modules/require-relative": { "version": "0.8.7", "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", @@ -21487,8 +21736,7 @@ "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" }, "node_modules/set-function-length": { "version": "1.2.2", @@ -21691,6 +21939,18 @@ "node": ">=4" } }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/sirv": { "version": "1.0.18", "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.18.tgz", @@ -22049,9 +22309,9 @@ } }, "node_modules/stream-chat": { - "version": "9.0.0-rc.5", - "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.5.tgz", - "integrity": "sha512-ttcWjdwraOOTACBFILQKbmi3mj1AmAW7YIWtoNcsBNvpBoOx5wceeuq4HMhDmuOvNTvGXEOGJayyPBSw5Y9eSQ==", + "version": "9.0.0-rc.6", + "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.6.tgz", + "integrity": "sha512-z4l1ngKMPCuOhSopFY+SFhBNWN8lr85IXBP2Ob2eNIC+6AE3CQ0ofc16O0h6Jk3bKLzY+EL7//XuPAbqPkoRiA==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@types/jsonwebtoken": "^9.0.8", @@ -22216,7 +22476,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -22234,7 +22493,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -22268,8 +22526,7 @@ "node_modules/string-width/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/stringify-object": { "version": "3.3.0", @@ -22289,7 +22546,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -22711,6 +22967,15 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "license": "MIT", + "dependencies": { + "readable-stream": "3" + } + }, "node_modules/thunky": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", @@ -22754,7 +23019,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -22780,6 +23044,15 @@ "node": ">=6" } }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -23068,6 +23341,12 @@ "integrity": "sha512-R8375j0qwXyIu/7R0tjdF06/sElHqbmdmWC9M2qQHpEVbvE4I5+38KJI7LUUmQMp7NVq4tKHiBMkT0NFM453Ig==", "dev": true }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "license": "MIT" + }, "node_modules/undici": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici/-/undici-5.26.5.tgz", @@ -23283,8 +23562,7 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "node_modules/utils-merge": { "version": "1.0.1", @@ -23898,6 +24176,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" + }, "node_modules/which-typed-array": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", @@ -29544,8 +29828,7 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-sequence-parser": { "version": "1.1.1", @@ -29572,7 +29855,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -29806,8 +30088,7 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base64-arraybuffer": { "version": "0.1.4", @@ -29847,8 +30128,7 @@ "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, "bindings": { "version": "1.5.0", @@ -29942,7 +30222,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -29952,7 +30231,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -30099,8 +30377,7 @@ "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "caniuse-lite": { "version": "1.0.30001607", @@ -30134,7 +30411,6 @@ "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, "requires": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -30432,8 +30708,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "config-chain": { "version": "1.1.13", @@ -30873,11 +31148,15 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "requires": { "ms": "2.1.2" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + }, "deep-equal": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", @@ -31709,8 +31988,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { "version": "8.57.0", @@ -32313,7 +32591,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -32365,7 +32642,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, "requires": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -32552,7 +32828,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "optional": true }, "function-bind": { @@ -32610,8 +32885,7 @@ "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-intrinsic": { "version": "1.2.4", @@ -32727,7 +33001,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -33132,6 +33405,11 @@ "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, "ignore-walk": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.4.tgz", @@ -33237,8 +33515,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { "version": "3.0.1", @@ -33373,7 +33650,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "requires": { "binary-extensions": "^2.0.0" } @@ -33430,20 +33706,17 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -33475,8 +33748,7 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-number-object": { "version": "1.0.7", @@ -34214,7 +34486,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, "requires": { "p-locate": "^4.1.0" } @@ -34812,7 +35083,6 @@ "version": "3.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -35252,6 +35522,46 @@ "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, + "nodemon": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", + "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", + "requires": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "noms": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", @@ -35328,8 +35638,7 @@ "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, "normalize-range": { "version": "0.1.2", @@ -37276,6 +37585,15 @@ "path-key": "^3.0.0" } }, + "npm-watch": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/npm-watch/-/npm-watch-0.13.0.tgz", + "integrity": "sha512-MYcgocqCzYA44feZhFoYj69FfSaO0EeRE1gcRcmPaXIpNhUMAhNJ1pwic2C4Hn0OPOQmZKSl90CPgmwvOsVhTg==", + "requires": { + "nodemon": "^3.0.1", + "through2": "^4.0.2" + } + }, "npmlog": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", @@ -37469,7 +37787,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, "requires": { "p-try": "^2.0.0" } @@ -37478,7 +37795,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, "requires": { "p-limit": "^2.2.0" } @@ -37525,8 +37841,7 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "pacote": { "version": "15.0.6", @@ -37703,8 +38018,7 @@ "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "path-is-absolute": { "version": "1.0.1", @@ -37818,8 +38132,7 @@ "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "pify": { "version": "4.0.1", @@ -38407,6 +38720,11 @@ "dev": true, "optional": true }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -38654,7 +38972,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -38665,7 +38982,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, "requires": { "picomatch": "^2.2.1" } @@ -38770,11 +39086,141 @@ } } }, + "replace": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/replace/-/replace-1.2.2.tgz", + "integrity": "sha512-C4EDifm22XZM2b2JOYe6Mhn+lBsLBAvLbK8drfUQLTfD1KYl/n3VaW/CDju0Ny4w3xTtegBpg8YNSpFJPUDSjA==", + "requires": { + "chalk": "2.4.2", + "minimatch": "3.0.5", + "yargs": "^15.3.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + } + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-from-string": { "version": "2.0.2", @@ -38782,6 +39228,11 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, "require-relative": { "version": "0.8.7", "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", @@ -39428,8 +39879,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" }, "set-function-length": { "version": "1.2.2", @@ -39597,6 +40047,14 @@ } } }, + "simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "requires": { + "semver": "^7.5.3" + } + }, "sirv": { "version": "1.0.18", "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.18.tgz", @@ -39890,9 +40348,9 @@ } }, "stream-chat": { - "version": "9.0.0-rc.5", - "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.5.tgz", - "integrity": "sha512-ttcWjdwraOOTACBFILQKbmi3mj1AmAW7YIWtoNcsBNvpBoOx5wceeuq4HMhDmuOvNTvGXEOGJayyPBSw5Y9eSQ==", + "version": "9.0.0-rc.6", + "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.6.tgz", + "integrity": "sha512-z4l1ngKMPCuOhSopFY+SFhBNWN8lr85IXBP2Ob2eNIC+6AE3CQ0ofc16O0h6Jk3bKLzY+EL7//XuPAbqPkoRiA==", "requires": { "@types/jsonwebtoken": "^9.0.8", "@types/ws": "^8.5.14", @@ -40037,7 +40495,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "requires": { "safe-buffer": "~5.2.0" } @@ -40052,7 +40509,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -40062,8 +40518,7 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" } } }, @@ -40101,7 +40556,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -40401,6 +40855,14 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "requires": { + "readable-stream": "3" + } + }, "thunky": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", @@ -40432,7 +40894,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "requires": { "is-number": "^7.0.0" } @@ -40449,6 +40910,11 @@ "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", "dev": true }, + "touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==" + }, "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -40641,6 +41107,11 @@ "integrity": "sha512-R8375j0qwXyIu/7R0tjdF06/sElHqbmdmWC9M2qQHpEVbvE4I5+38KJI7LUUmQMp7NVq4tKHiBMkT0NFM453Ig==", "dev": true }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, "undici": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici/-/undici-5.26.5.tgz", @@ -40782,8 +41253,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "utils-merge": { "version": "1.0.1", @@ -41226,6 +41696,11 @@ "is-weakset": "^2.0.3" } }, + "which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, "which-typed-array": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", diff --git a/package.json b/package.json index 49e496b9..92a13692 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,9 @@ { "name": "stream-chat-angular", "version": "0.0.0", + "watch": { + "remove-stream-chat-augmentation": "dist/stream-chat-angular/stream-chat.d.ts.map" + }, "scripts": { "prepare": "husky install", "postinstall": "npm run config:dev & npm run copy-css", @@ -14,8 +17,14 @@ "prestart:dev:customizations-example": "npm run config:dev", "start:dev:customizations-example": "rm -rf dist & npm run watch & (wait-on dist && ng serve customizations-example --host 0.0.0.0)", "build": "ng build stream-chat-angular", + "postbuild": "npm run remove-stream-chat-augmentation", + "delete-stream-chat-declaration": "rm -f dist/stream-chat-angular/stream-chat.d.ts", + "delete-stream-chat-declaration-map": "rm -f dist/stream-chat-angular/stream-chat.d.ts.map", + "remove-stream-chat-reference": "replace '/// ' '' dist/stream-chat-angular/public-api.d.ts", + "remove-stream-chat-augmentation": "npm run delete-stream-chat-declaration && npm run delete-stream-chat-declaration-map && npm run remove-stream-chat-reference", "build:prod": "npm run copy-css && ng build stream-chat-angular --configuration production", - "watch": "ng build stream-chat-angular --watch --configuration development", + "postbuild:prod": "npm run remove-stream-chat-augmentation", + "watch": "ng build stream-chat-angular --watch --configuration development & npm-watch", "test": "rm -rf dist & npm run watch & (wait-on dist && ng run stream-chat-angular:test)", "test:ci": "ng run stream-chat-angular:test --browsers ChromeHeadlessCustom --watch false", "lint": "ng lint", @@ -115,10 +124,12 @@ "emoji-regex": "^10.3.0", "fix-webm-duration": "^1.0.6", "ngx-float-ui": "^15.0.0", + "npm-watch": "^0.13.0", "pretty-bytes": "^6.1.1", + "replace": "^1.2.2", "rxjs": "~7.4.0", "starwars-names": "^1.6.0", - "stream-chat": "9.0.0-rc.5", + "stream-chat": "9.0.0-rc.6", "ts-node": "^10.9.2", "tslib": "^2.3.0", "uuid": "^9.0.1", diff --git a/projects/customizations-example/src/app/app.component.html b/projects/customizations-example/src/app/app.component.html index 71c21500..d1d01afd 100644 --- a/projects/customizations-example/src/app/app.component.html +++ b/projects/customizations-example/src/app/app.component.html @@ -256,7 +256,7 @@ let-latestMessageText="latestMessageText" let-latestMessage="latestMessage" > -
Channel title: {{ channel.title }}
+
Channel title: {{ channel.name }}
Display title: {{ channelDisplayTitle }}
Unread count: {{ unreadCount }}
Latest message text: {{ latestMessageText }}
diff --git a/projects/customizations-example/src/app/stream-chat.d.ts b/projects/customizations-example/src/app/stream-chat.d.ts new file mode 100644 index 00000000..4ca0d2f8 --- /dev/null +++ b/projects/customizations-example/src/app/stream-chat.d.ts @@ -0,0 +1,7 @@ +import { DefaultAttachmentData, DefaultChannelData } from 'stream-chat-angular'; + +declare module 'stream-chat' { + interface CustomChannelData extends DefaultChannelData {} + + interface CustomAttachmentData extends DefaultAttachmentData {} +} diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index 730f0498..d219a780 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -22,7 +22,7 @@ "@breezystack/lamejs": "^1.2.7", "@ngx-translate/core": "^14.0.0 || ^15.0.0 || ^16.0.0", "rxjs": "^7.4.0", - "stream-chat": "9.0.0-rc.5" + "stream-chat": "9.0.0-rc.6" }, "peerDependenciesMeta": { "@breezystack/lamejs": { diff --git a/projects/stream-chat-angular/src/lib/types.ts b/projects/stream-chat-angular/src/lib/types.ts index f67fcedc..3bdcb517 100644 --- a/projects/stream-chat-angular/src/lib/types.ts +++ b/projects/stream-chat-angular/src/lib/types.ts @@ -470,3 +470,20 @@ export type GalleryAttachment = { type: 'gallery'; images: Attachment[]; }; + +export interface DefaultChannelData { + image?: string; +} + +export interface DefaultAttachmentData { + /** + * @deprecated Please use `image_url` instead + */ + img_url?: string; + /** + * Will be `true` if an attachment was added using `attachmentService.addAttachment` + * + * This is a non-standard property, other SDKs will ignore this property + */ + isCustomAttachment?: boolean; +} diff --git a/projects/stream-chat-angular/src/public-api.ts b/projects/stream-chat-angular/src/public-api.ts index 3cd6cb60..e44ad7f6 100644 --- a/projects/stream-chat-angular/src/public-api.ts +++ b/projects/stream-chat-angular/src/public-api.ts @@ -1,27 +1,8 @@ -declare module 'stream-chat' { - interface CustomUserData { - image?: string; - } - interface CustomAttachmentData { - /** - * @deprecated Please use `image_url` instead - */ - img_url?: string; - /** - * Will be `true` if an attachment was added using `attachmentService.addAttachment` - * - * This is a non-standard property, other SDKs will ignore this property - */ - isCustomAttachment?: boolean; - } - - interface CustomChannelData { - image?: string; - } -} /* * Public API Surface of stream-chat-angular */ +// eslint-disable-next-line @typescript-eslint/triple-slash-reference +/// export * from './lib/chat-client.service'; export * from './lib/channel.service'; export * from './lib/theme.service'; diff --git a/projects/stream-chat-angular/src/stream-chat.ts b/projects/stream-chat-angular/src/stream-chat.ts new file mode 100644 index 00000000..f91a5932 --- /dev/null +++ b/projects/stream-chat-angular/src/stream-chat.ts @@ -0,0 +1,8 @@ +import 'stream-chat'; +import { DefaultChannelData, DefaultAttachmentData } from './lib/types'; + +declare module 'stream-chat' { + interface CustomAttachmentData extends DefaultAttachmentData {} + + interface CustomChannelData extends DefaultChannelData {} +} diff --git a/projects/stream-chat-angular/src/test.ts b/projects/stream-chat-angular/src/test.ts index 35d409ff..004bd687 100644 --- a/projects/stream-chat-angular/src/test.ts +++ b/projects/stream-chat-angular/src/test.ts @@ -1,5 +1,6 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files - +// eslint-disable-next-line @typescript-eslint/triple-slash-reference +/// import 'zone.js'; import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; diff --git a/projects/stream-chat-angular/tsconfig.spec.json b/projects/stream-chat-angular/tsconfig.spec.json index 1cf009e9..fafd1e12 100644 --- a/projects/stream-chat-angular/tsconfig.spec.json +++ b/projects/stream-chat-angular/tsconfig.spec.json @@ -5,6 +5,6 @@ "outDir": "../../out-tsc/spec", "types": ["jasmine"] }, - "files": ["src/test.ts", "src/public-api.ts"], + "files": ["src/test.ts"], "include": ["**/*.spec.ts", "**/*.d.ts"] } From 4b4642d51f9cce61b4e3bc393800e2f7e488b859 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 7 Mar 2025 15:17:22 +0100 Subject: [PATCH 06/17] chore: turn off dry run --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 92a13692..91189032 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "channel": "rc" } ], - "dryRun": true, + "dryRun": false, "plugins": [ [ "@semantic-release/commit-analyzer", @@ -79,7 +79,7 @@ "@semantic-release/npm", { "pkgRoot": "./dist/stream-chat-angular", - "npmPublish": false + "npmPublish": true } ], [ From f260fbe0749d0e6c61e0ac778d266b975a234fc5 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 7 Mar 2025 14:20:08 +0000 Subject: [PATCH 07/17] chore(release): 6.0.0-rc.1 [skip ci] # [6.0.0-rc.1](https://github.com/GetStream/stream-chat-angular/compare/v5.13.0...v6.0.0-rc.1) (2025-03-07) ### Bug Fixes * remove stream-chat module augmentation from stream-chat-angular ([bdc7890](https://github.com/GetStream/stream-chat-angular/commit/bdc789091c5bc4e7033e4874df526cb6307b311c)) ### Features * add support for @ngx-translate/core@16 ([17bc676](https://github.com/GetStream/stream-chat-angular/commit/17bc676afc171931dfe05abe9e80e483b0096d64)) * drop generics for custom typing ([a224563](https://github.com/GetStream/stream-chat-angular/commit/a224563204576f288c4aac230261cedb256de509)) ### BREAKING CHANGES * stream-chat types are no longer generic, see how you can type your custom types in the SDK v6 upgrade guide --- projects/stream-chat-angular/package.json | 2 +- projects/stream-chat-angular/src/assets/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index d219a780..c16f82e1 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -1,6 +1,6 @@ { "name": "stream-chat-angular", - "version": "5.13.0", + "version": "6.0.0-rc.1", "description": "Angular components to create chat conversations or livestream style chat", "author": "GetStream", "homepage": "https://getstream.io/chat/", diff --git a/projects/stream-chat-angular/src/assets/version.ts b/projects/stream-chat-angular/src/assets/version.ts index 4e916038..891480c9 100644 --- a/projects/stream-chat-angular/src/assets/version.ts +++ b/projects/stream-chat-angular/src/assets/version.ts @@ -1 +1 @@ -export const version = '5.13.0'; +export const version = '6.0.0-rc.1'; From 7e62ad695f0424fd439dd93d3fbc74de4ec1a642 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 7 Mar 2025 17:03:09 +0100 Subject: [PATCH 08/17] refactor: move SDK custom fields to separate file --- .../stream-chat-angular/src/lib/types-custom.ts | 16 ++++++++++++++++ projects/stream-chat-angular/src/lib/types.ts | 17 ----------------- projects/stream-chat-angular/src/public-api.ts | 1 + projects/stream-chat-angular/src/stream-chat.ts | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 projects/stream-chat-angular/src/lib/types-custom.ts diff --git a/projects/stream-chat-angular/src/lib/types-custom.ts b/projects/stream-chat-angular/src/lib/types-custom.ts new file mode 100644 index 00000000..81267bd0 --- /dev/null +++ b/projects/stream-chat-angular/src/lib/types-custom.ts @@ -0,0 +1,16 @@ +export interface DefaultChannelData { + image?: string; +} + +export interface DefaultAttachmentData { + /** + * @deprecated Please use `image_url` instead + */ + img_url?: string; + /** + * Will be `true` if an attachment was added using `attachmentService.addAttachment` + * + * This is a non-standard property, other SDKs will ignore this property + */ + isCustomAttachment?: boolean; +} diff --git a/projects/stream-chat-angular/src/lib/types.ts b/projects/stream-chat-angular/src/lib/types.ts index 3bdcb517..f67fcedc 100644 --- a/projects/stream-chat-angular/src/lib/types.ts +++ b/projects/stream-chat-angular/src/lib/types.ts @@ -470,20 +470,3 @@ export type GalleryAttachment = { type: 'gallery'; images: Attachment[]; }; - -export interface DefaultChannelData { - image?: string; -} - -export interface DefaultAttachmentData { - /** - * @deprecated Please use `image_url` instead - */ - img_url?: string; - /** - * Will be `true` if an attachment was added using `attachmentService.addAttachment` - * - * This is a non-standard property, other SDKs will ignore this property - */ - isCustomAttachment?: boolean; -} diff --git a/projects/stream-chat-angular/src/public-api.ts b/projects/stream-chat-angular/src/public-api.ts index e44ad7f6..3b245a07 100644 --- a/projects/stream-chat-angular/src/public-api.ts +++ b/projects/stream-chat-angular/src/public-api.ts @@ -57,6 +57,7 @@ export * from './lib/custom-templates.service'; export * from './lib/message-reactions.service'; export * from './lib/date-parser.service'; export * from './lib/types'; +export * from './lib/types-custom'; export * from './lib/message.service'; export * from './lib/message-actions.service'; export * from './lib/voice-recording/voice-recording.component'; diff --git a/projects/stream-chat-angular/src/stream-chat.ts b/projects/stream-chat-angular/src/stream-chat.ts index f91a5932..ccd0148c 100644 --- a/projects/stream-chat-angular/src/stream-chat.ts +++ b/projects/stream-chat-angular/src/stream-chat.ts @@ -1,5 +1,5 @@ import 'stream-chat'; -import { DefaultChannelData, DefaultAttachmentData } from './lib/types'; +import { DefaultChannelData, DefaultAttachmentData } from './lib/types-custom'; declare module 'stream-chat' { interface CustomAttachmentData extends DefaultAttachmentData {} From 87880f2b5d5a660411745966693150b633daada2 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Mon, 10 Mar 2025 10:09:12 +0100 Subject: [PATCH 09/17] docs: update docs links --- README.md | 4 +- copy-generated-service-docs.ts | 7 +- package.json | 4 +- projects/stream-chat-angular/README.md | 4 +- .../lib/attachment-configuration.service.ts | 2 +- .../src/lib/attachment.service.ts | 6 +- .../avatar-placeholder.component.ts | 2 +- .../src/lib/channel.service.ts | 32 +++---- .../src/lib/channel/channel.component.ts | 2 +- .../src/lib/chat-client.service.ts | 6 +- .../src/lib/custom-templates.service.ts | 88 +++++++++---------- .../icon-placeholder.component.ts | 2 +- ...loading-indicator-placeholder.component.ts | 2 +- .../message-actions-box.component.ts | 4 +- .../src/lib/message-actions.service.ts | 4 +- .../message-bounce-prompt.component.ts | 2 +- .../autocomplete-textarea.component.ts | 8 +- .../lib/message-input/emoji-input.service.ts | 4 +- .../message-input-config.service.ts | 6 +- .../message-input/message-input.component.ts | 12 +-- .../textarea/textarea.component.ts | 4 +- .../message-reactions-selector.component.ts | 4 +- .../src/lib/message-reactions.service.ts | 6 +- .../message-reactions.component.ts | 6 +- .../src/lib/message.service.ts | 2 +- .../src/lib/message/message.component.ts | 4 +- .../src/lib/notification.service.ts | 2 +- .../notification/notification.component.ts | 2 +- .../src/lib/stream-i18n.service.ts | 2 +- .../src/lib/theme.service.ts | 2 +- .../src/lib/thread/thread.component.ts | 2 +- 31 files changed, 120 insertions(+), 117 deletions(-) diff --git a/README.md b/README.md index 354bdb53..a94c302a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ - [Register](https://getstream.io/chat/trial/) to get an API key for Stream Chat - [Angular Chat Tutorial](https://getstream.io/chat/angular/tutorial/) -- [Docs](https://getstream.io/chat/docs/sdk/angular/) +- [Docs](https://getstream.io/chat/docs/sdk/angular/v6-rc/) - [Chat UI Kit](https://getstream.io/chat/ui-kit/) - [Demo application](https://angular-chat-demo-getstreamio.vercel.app/) - [Codesandbox](https://codesandbox.io/p/devbox/stream-chat-angular-sample-app-rc3hyw) @@ -33,7 +33,7 @@ For complete pricing and details visit our [Chat Pricing Page](https://getstream ## Docs -The [docs](https://getstream.io/chat/docs/sdk/angular/) provide a brief description about the components and services in the library. +The [docs](https://getstream.io/chat/docs/sdk/angular/v6-rc/) provide a brief description about the components and services in the library. The Angular library is created using the [stream-chat-js](https://github.com/getstream/stream-chat-js) library. For the most common use cases our services should give a nice abstraction over this library, however you might need it for more advanced customization, the [documentation](https://getstream.io/chat/docs/js/) is on our website. diff --git a/copy-generated-service-docs.ts b/copy-generated-service-docs.ts index f4006499..7697396a 100644 --- a/copy-generated-service-docs.ts +++ b/copy-generated-service-docs.ts @@ -36,7 +36,10 @@ fs.readdir(sourcePath, (err: any, files: string[]) => { `\n` + `title: ${file.replace('.md', '')}` + `\n` + - `slug: /chat/docs/sdk/angular/services/${file.replace('.md', '')}/` + + `slug: /chat/docs/sdk/angular/v6-rc/services/${file.replace( + '.md', + '' + )}/` + `\n` + `---` + '\n\n' + @@ -44,7 +47,7 @@ fs.readdir(sourcePath, (err: any, files: string[]) => { .replace(`# Class: ${file.replace('.md', '')}`, '') .replace( /\b(?!README)(\w+)\.md\b/g, - '/chat/docs/sdk/angular/services/$1' + '/chat/docs/sdk/angular/v6-rc/services/$1' ) .replace(/•\s/g, '') .replace(/▸\s/g, '') diff --git a/package.json b/package.json index 91189032..09eefd1c 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,10 @@ "preanalyze:sample-app": "npm run build:sample-app", "analyze:sample-app": "webpack-bundle-analyzer dist/sample-app/stats.json", "copy-css": "rm -rf projects/stream-chat-angular/src/assets/styles && copyfiles --up 5 \"node_modules/@stream-io/stream-chat-css/dist/v2/**/*\" projects/stream-chat-angular/src/assets/styles && copyfiles --up 5 \"node_modules/@stream-io/stream-chat-css/dist/assets/**/*\" projects/stream-chat-angular/src/assets/assets", - "generate-docs": "npm run typedoc:services && npm run typedoc:components && npm run copy-docs:v5", + "generate-docs": "npm run typedoc:services && npm run typedoc:components && npm run copy-docs:v6", "typedoc:services": "typedoc --plugin typedoc-plugin-markdown --plugin typedoc-plugin-reference-excluder --cleanOutputDir true --excludeConstructors true --hideBreadcrumbs true --hideInPageTOC true --excludePrivate true --out temp-service-docs --exclude '!**/*service.ts' --excludeNotDocumented --tsconfig projects/stream-chat-angular/tsconfig.lib.json projects/stream-chat-angular/src/public-api.ts", "typedoc:components": "typedoc --plugin typedoc-plugin-markdown --plugin typedoc-plugin-reference-excluder --cleanOutputDir true --excludeConstructors true --sort source-order --hideBreadcrumbs true --hideInPageTOC true --excludePrivate true --excludeNotDocumented --out temp-component-docs --exclude '!**/*component.ts' --tsconfig projects/stream-chat-angular/tsconfig.lib.json projects/stream-chat-angular/src/public-api.ts", - "copy-docs:v5": "ts-node copy-generated-service-docs.ts ../docs/data/docs/chat-sdk/angular/v5-latest/06-services & (ts-node remove-generated-component-docs-content ../docs/data/docs/chat-sdk/angular/v5-latest/05-components && ts-node copy-generated-component-docs.ts ../docs/data/docs/chat-sdk/angular/v5-latest/05-components)" + "copy-docs:v6": "ts-node copy-generated-service-docs.ts ../docs/data/docs/chat-sdk/angular/v6-rc/06-services & (ts-node remove-generated-component-docs-content ../docs/data/docs/chat-sdk/angular/v6-rc/05-components && ts-node copy-generated-component-docs.ts ../docs/data/docs/chat-sdk/angular/v6-rc/05-components)" }, "lint-staged": { "**/*": [ diff --git a/projects/stream-chat-angular/README.md b/projects/stream-chat-angular/README.md index 04f70d1d..6803e2c0 100644 --- a/projects/stream-chat-angular/README.md +++ b/projects/stream-chat-angular/README.md @@ -11,7 +11,7 @@ - [Register](https://getstream.io/chat/trial/) to get an API key for Stream Chat - [Angular Chat Tutorial](https://getstream.io/chat/angular/tutorial/) - [Demo Apps](https://getstream.io/chat/demos/) -- [Docs](https://getstream.io/chat/docs/sdk/angular/) +- [Docs](https://getstream.io/chat/docs/sdk/angular/v6-rc/) - [Chat UI Kit](https://getstream.io/chat/ui-kit/) With our component library, you can build a variety of chat use cases, including: @@ -32,7 +32,7 @@ For complete pricing and details visit our [Chat Pricing Page](https://getstream ## Docs -The [docs](https://getstream.io/chat/docs/sdk/angular/) provide a brief description about the components and services in the library. +The [docs](https://getstream.io/chat/docs/sdk/angular/v6-rc/) provide a brief description about the components and services in the library. The Angular library is created using the [stream-chat-js](https://github.com/getstream/stream-chat-js) library. For the most common use cases our services should give a nice abstraction over this library, however you might need it for more advanced customization, the [documentation](https://getstream.io/chat/docs/js/) is on our website. diff --git a/projects/stream-chat-angular/src/lib/attachment-configuration.service.ts b/projects/stream-chat-angular/src/lib/attachment-configuration.service.ts index b38cda14..ad16a15f 100644 --- a/projects/stream-chat-angular/src/lib/attachment-configuration.service.ts +++ b/projects/stream-chat-angular/src/lib/attachment-configuration.service.ts @@ -239,7 +239,7 @@ export class AttachmentConfigurationService { sizeRestriction = undefined; if (displayWarning) { console.warn( - `Invalid value set for height/max-height and/or max-width for HTML element, this can cause scrolling issues inside the message list, more info https://getstream.io/chat/docs/sdk/angular/components/AttachmentListComponent/#image-and-video-sizing, attachment URL: ${url.toString()}` + `Invalid value set for height/max-height and/or max-width for HTML element, this can cause scrolling issues inside the message list, more info https://getstream.io/chat/docs/sdk/angular/v6-rc/components/AttachmentListComponent/#image-and-video-sizing, attachment URL: ${url.toString()}` ); } } diff --git a/projects/stream-chat-angular/src/lib/attachment.service.ts b/projects/stream-chat-angular/src/lib/attachment.service.ts index 1538290b..2984b23a 100644 --- a/projects/stream-chat-angular/src/lib/attachment.service.ts +++ b/projects/stream-chat-angular/src/lib/attachment.service.ts @@ -34,13 +34,13 @@ export class AttachmentService { */ attachmentUploadInProgressCounter$ = new BehaviorSubject(0); /** - * Emits the state of the uploads ([`AttachmentUpload[]`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)), it adds a state (`success`, `error` or `uploading`) to each file the user selects for upload. It is used by the [`AttachmentPreviewList`](/chat/docs/sdk/angular/components/AttachmentPreviewListComponent/) to display the attachment previews. + * Emits the state of the uploads ([`AttachmentUpload[]`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)), it adds a state (`success`, `error` or `uploading`) to each file the user selects for upload. It is used by the [`AttachmentPreviewList`](/chat/docs/sdk/angular/v6-rc/components/AttachmentPreviewListComponent/) to display the attachment previews. */ attachmentUploads$: Observable; /** * You can get and set the list if uploaded custom attachments * - * By default the SDK components won't display these, but you can provide your own `customAttachmentPreviewListTemplate$` and `customAttachmentListTemplate$` for the [`CustomTemplatesService`](/chat/docs/sdk/angular/services/CustomTemplatesService/). + * By default the SDK components won't display these, but you can provide your own `customAttachmentPreviewListTemplate$` and `customAttachmentListTemplate$` for the [`CustomTemplatesService`](/chat/docs/sdk/angular/v6-rc/services/CustomTemplatesService/). */ customAttachments$ = new BehaviorSubject([]); /** @@ -204,7 +204,7 @@ export class AttachmentService { /** * You can add custom `image`, `video` and `file` attachments using this method. * - * Note: If you just want to use your own CDN for file uploads, you don't necessary need this method, you can just specify you own upload function in the [`ChannelService`](/chat/docs/sdk/angular/services/ChannelService/) + * Note: If you just want to use your own CDN for file uploads, you don't necessary need this method, you can just specify you own upload function in the [`ChannelService`](/chat/docs/sdk/angular/v6-rc/services/ChannelService/) * @param attachment * * Will set `isCustomAttachment` to `true` on the attachment. This is a non-standard field, other SDKs will ignore this property. diff --git a/projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.ts b/projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.ts index 465ad70b..44483e49 100644 --- a/projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.ts +++ b/projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.ts @@ -4,7 +4,7 @@ import { CustomTemplatesService } from '../custom-templates.service'; import { AvatarContext, AvatarLocation, AvatarType } from '../types'; /** - * The `AvatarPlaceholder` component displays the [default avatar](/chat/docs/sdk/angular/components/AvatarComponent/) unless a [custom template](/chat/docs/sdk/angular/services/CustomTemplatesService/) is provided. This component is used by the SDK internally, you likely won't need to use it. + * The `AvatarPlaceholder` component displays the [default avatar](/chat/docs/sdk/angular/v6-rc/components/AvatarComponent/) unless a [custom template](/chat/docs/sdk/angular/v6-rc/services/CustomTemplatesService/) is provided. This component is used by the SDK internally, you likely won't need to use it. */ @Component({ selector: 'stream-avatar-placeholder', diff --git a/projects/stream-chat-angular/src/lib/channel.service.ts b/projects/stream-chat-angular/src/lib/channel.service.ts index d1f72cd7..785b21d6 100644 --- a/projects/stream-chat-angular/src/lib/channel.service.ts +++ b/projects/stream-chat-angular/src/lib/channel.service.ts @@ -59,7 +59,7 @@ export class ChannelService { * Emits the currently loaded and [watched](/chat/docs/javascript/watch_channel/) channel list. * * :::important - * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail. + * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/v6-rc/concepts/change-detection/) explains this in detail. * ::: */ channels$: Observable; @@ -71,7 +71,7 @@ export class ChannelService { * Emits the currently active channel. * * :::important - * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail. + * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/v6-rc/concepts/change-detection/) explains this in detail. * ::: * * The active channel will always be marked as read when a new message is received @@ -120,7 +120,7 @@ export class ChannelService { /** * If you're using [semantic filters for moderation](/moderation/docs/) you can set up rules for bouncing messages. * - * If a message is bounced, it will be emitted via this `Observable`. The built-in [`MessageBouncePrompt` component](/chat/docs/sdk/angular/components/MessageBouncePromptComponent/) will display the bounce option to the user if a bounced message is clicked. + * If a message is bounced, it will be emitted via this `Observable`. The built-in [`MessageBouncePrompt` component](/chat/docs/sdk/angular/v6-rc/components/MessageBouncePromptComponent/) will display the bounce option to the user if a bounced message is clicked. */ bouncedMessage$: BehaviorSubject; /** @@ -136,7 +136,7 @@ export class ChannelService { */ activeChannelUnreadCount?: number; /** - * Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/) + * Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/) * * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel. */ @@ -148,7 +148,7 @@ export class ChannelService { ) => void ) => void; /** - * Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). + * Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/). * * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel. */ @@ -160,7 +160,7 @@ export class ChannelService { ) => void ) => void; /** - * Custom event handler to call when the user is removed from a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). + * Custom event handler to call when the user is removed from a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/). * * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel. */ @@ -172,7 +172,7 @@ export class ChannelService { ) => void ) => void; /** - * Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). + * Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/). * * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel. */ @@ -188,7 +188,7 @@ export class ChannelService { parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** - * Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). + * Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/). * * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel. */ @@ -204,7 +204,7 @@ export class ChannelService { parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** - * Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). + * Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/). * * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel. */ @@ -220,7 +220,7 @@ export class ChannelService { parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** - * Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). + * Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/). * * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel. */ @@ -236,7 +236,7 @@ export class ChannelService { parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** - * Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). + * Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/). * * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel. */ @@ -252,7 +252,7 @@ export class ChannelService { parentMessageSetter: (message: StreamMessage | undefined) => void ) => void; /** - * Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/). + * Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/). * * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel. */ @@ -773,7 +773,7 @@ export class ChannelService { } /** - * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](/chat/docs/sdk/angular/services/ChatClientService/#disconnectuser/). + * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](/chat/docs/sdk/angular/v6-rc/services/ChatClientService/#disconnectuser/). */ reset() { this.deselectActiveChannel(); @@ -969,7 +969,7 @@ export class ChannelService { /** * Uploads files to the channel. If you want to know more about [file uploads](/chat/docs/javascript/file_uploads/) check out the platform documentation. - * @param uploads the attachments to upload (output of the [`AttachmentService`](/chat/docs/sdk/angular/services/AttachmentService/)) + * @param uploads the attachments to upload (output of the [`AttachmentService`](/chat/docs/sdk/angular/v6-rc/services/AttachmentService/)) * @returns the result of file upload requests */ async uploadAttachments( @@ -1050,7 +1050,7 @@ export class ChannelService { /** * Deletes an uploaded file by URL. If you want to know more about [file uploads](/chat/docs/javascript/file_uploads/) check out the platform documentation - * @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](/chat/docs/sdk/angular/services/AttachmentService/)) + * @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](/chat/docs/sdk/angular/v6-rc/services/AttachmentService/)) */ async deleteAttachment(attachmentUpload: AttachmentUpload) { const channel = this.activeChannelSubject.getValue()!; @@ -1656,7 +1656,7 @@ export class ChannelService { /** * Get the last 1200 reactions of a message in the current active channel. If you need to fetch more reactions please use the [following endpoint](/chat/docs/javascript/send_reaction/#paginating-reactions). - * @deprecated use [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/services/MessageReactionsService/#queryreactions) instead + * @deprecated use [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/v6-rc/services/MessageReactionsService/#queryreactions) instead * @param messageId * @returns all reactions of a message */ diff --git a/projects/stream-chat-angular/src/lib/channel/channel.component.ts b/projects/stream-chat-angular/src/lib/channel/channel.component.ts index cb7a6f94..422567d2 100644 --- a/projects/stream-chat-angular/src/lib/channel/channel.component.ts +++ b/projects/stream-chat-angular/src/lib/channel/channel.component.ts @@ -6,7 +6,7 @@ import { ThemeService } from '../theme.service'; import { CustomTemplatesService } from '../custom-templates.service'; /** - * The `Channel` component is a container component that displays the [`ChannelHeader`](/chat/docs/sdk/angular/components/ChannelHeaderComponent/), [`MessageList`](/chat/docs/sdk/angular/components/MessageListComponent), [`NotificationList`](/chat/docs/sdk/angular/components/NotificationListComponent/) and [`MessageInput`](/chat/docs/sdk/angular/components/MessageInputComponent/) components. You can also provide the [`Thread`](/chat/docs/sdk/angular/components/ThreadComponent/) component to use message [threads](/chat/docs/javascript/threads/). + * The `Channel` component is a container component that displays the [`ChannelHeader`](/chat/docs/sdk/angular/v6-rc/components/ChannelHeaderComponent/), [`MessageList`](/chat/docs/sdk/angular/v6-rc/components/MessageListComponent), [`NotificationList`](/chat/docs/sdk/angular/v6-rc/components/NotificationListComponent/) and [`MessageInput`](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent/) components. You can also provide the [`Thread`](/chat/docs/sdk/angular/v6-rc/components/ThreadComponent/) component to use message [threads](/chat/docs/javascript/threads/). */ @Component({ selector: 'stream-channel', diff --git a/projects/stream-chat-angular/src/lib/chat-client.service.ts b/projects/stream-chat-angular/src/lib/chat-client.service.ts index eec1e995..0c84ca3d 100644 --- a/projects/stream-chat-angular/src/lib/chat-client.service.ts +++ b/projects/stream-chat-angular/src/lib/chat-client.service.ts @@ -34,7 +34,7 @@ export class ChatClientService { /** * Emits [`ClientEvent`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/chat-client.service.ts) events. The platform documentation covers [the list of client, user presence and notification events](/chat/docs/javascript/event_object/). * :::important - * For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail. + * For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/v6-rc/concepts/change-detection/) explains this in detail. * ::: */ events$: Observable; @@ -47,7 +47,7 @@ export class ChatClientService { */ connectionState$: Observable<'offline' | 'online'>; /** - * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](/chat/docs/sdk/angular/code-examples/channel-invites/) guide. + * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](/chat/docs/sdk/angular/v6-rc/code-examples/channel-invites/) guide. */ pendingInvites$: Observable; /** @@ -188,7 +188,7 @@ export class ChatClientService { } /** - * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](/chat/docs/sdk/angular/services/ChannelService/#reset/). + * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#reset/). */ async disconnectUser() { this.pendingInvitesSubject.next([]); diff --git a/projects/stream-chat-angular/src/lib/custom-templates.service.ts b/projects/stream-chat-angular/src/lib/custom-templates.service.ts index d643e98b..e3576938 100644 --- a/projects/stream-chat-angular/src/lib/custom-templates.service.ts +++ b/projects/stream-chat-angular/src/lib/custom-templates.service.ts @@ -51,145 +51,145 @@ import { }) export class CustomTemplatesService { /** - * The autocomplete list item template for mentioning users (used in the [`AutocompleteTextareaComponent`](/chat/docs/sdk/angular/components/AutocompleteTextareaComponent/)) + * The autocomplete list item template for mentioning users (used in the [`AutocompleteTextareaComponent`](/chat/docs/sdk/angular/v6-rc/components/AutocompleteTextareaComponent/)) */ mentionAutocompleteItemTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The autocomplete list item template for commands (used in the [`AutocompleteTextareaComponent`](/chat/docs/sdk/angular/components/AutocompleteTextareaComponent/)) + * The autocomplete list item template for commands (used in the [`AutocompleteTextareaComponent`](/chat/docs/sdk/angular/v6-rc/components/AutocompleteTextareaComponent/)) */ commandAutocompleteItemTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * Template used to display an item in the [channel list](/chat/docs/sdk/angular/components/ChannelListComponent/) (instead of the default [channal list item](/chat/docs/sdk/angular/components/ChannelPreviewComponent/)) + * Template used to display an item in the [channel list](/chat/docs/sdk/angular/v6-rc/components/ChannelListComponent/) (instead of the default [channal list item](/chat/docs/sdk/angular/v6-rc/components/ChannelPreviewComponent/)) * */ channelPreviewTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used for displaying a [mention inside a message](/chat/docs/sdk/angular/code-examples/mention-actions/) + * The template used for displaying a [mention inside a message](/chat/docs/sdk/angular/v6-rc/code-examples/mention-actions/) * */ mentionTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template for [emoji picker](/chat/docs/sdk/angular/code-examples/emoji-picker) + * The template for [emoji picker](/chat/docs/sdk/angular/v6-rc/code-examples/emoji-picker) * */ emojiPickerTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The typing indicator template used in the [message list](/chat/docs/sdk/angular/components/MessageListComponent/) + * The typing indicator template used in the [message list](/chat/docs/sdk/angular/v6-rc/components/MessageListComponent/) * */ typingIndicatorTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display a message in the [message list](/chat/docs/sdk/angular/components/MessageListComponent/) (instead of the [default message component](/chat/docs/sdk/angular/components/MessageComponent/)) + * The template used to display a message in the [message list](/chat/docs/sdk/angular/v6-rc/components/MessageListComponent/) (instead of the [default message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/)) * */ messageTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template for channel actions displayed in the [channel header](/chat/docs/sdk/angular/components/ChannelHeaderComponent/) (by default no channel action is displayed) + * The template for channel actions displayed in the [channel header](/chat/docs/sdk/angular/v6-rc/components/ChannelHeaderComponent/) (by default no channel action is displayed) * */ channelActionsTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display attachments of a [message](/chat/docs/sdk/angular/components/MessageComponent/) (instead of the [default attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/)) + * The template used to display attachments of a [message](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) (instead of the [default attachment list](/chat/docs/sdk/angular/v6-rc/components/AttachmentListComponent/)) * */ attachmentListTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display attachments in the [message input](/chat/docs/sdk/angular/components/MessageInputComponent) component (instead of the [default attachment preview](/chat/docs/sdk/angular/components/AttachmentPreviewListComponent)) + * The template used to display attachments in the [message input](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent) component (instead of the [default attachment preview](/chat/docs/sdk/angular/v6-rc/components/AttachmentPreviewListComponent)) * */ attachmentPreviewListTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display avatars for channels and users (instead of the [default avatar](/chat/docs/sdk/angular/components/AvatarComponent/)) + * The template used to display avatars for channels and users (instead of the [default avatar](/chat/docs/sdk/angular/v6-rc/components/AvatarComponent/)) * */ avatarTemplate$ = new BehaviorSubject | undefined>( undefined ); /** - * Template for displaying icons (instead of the [default icon component](/chat/docs/sdk/angular/components/IconComponent/)) + * Template for displaying icons (instead of the [default icon component](/chat/docs/sdk/angular/v6-rc/components/IconComponent/)) * */ iconTemplate$ = new BehaviorSubject | undefined>( undefined ); /** - * Template for displaying the loading indicator (instead of the [default loading indicator](/chat/docs/sdk/angular/components/LoadingIndicatorComponent/)) + * Template for displaying the loading indicator (instead of the [default loading indicator](/chat/docs/sdk/angular/v6-rc/components/LoadingIndicatorComponent/)) * */ loadingIndicatorTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * Template for displaying the message actions box (instead of the [default message actions box](/chat/docs/sdk/angular/components/MessageActionsBoxComponent/)) + * Template for displaying the message actions box (instead of the [default message actions box](/chat/docs/sdk/angular/v6-rc/components/MessageActionsBoxComponent/)) * */ messageActionsBoxTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used for displaying an item in the [message actions box](/chat/docs/sdk/angular/components/MessageActionsBoxComponent/) + * The template used for displaying an item in the [message actions box](/chat/docs/sdk/angular/v6-rc/components/MessageActionsBoxComponent/) * */ messageActionsBoxItemTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display the reactions of a [message](/chat/docs/sdk/angular/components/MessageComponent/), and the selector to add a reaction to a message (instead of the [default message reactions component](/chat/docs/sdk/angular/components/MessageReactionsComponent/)) + * The template used to display the reactions of a [message](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/), and the selector to add a reaction to a message (instead of the [default message reactions component](/chat/docs/sdk/angular/v6-rc/components/MessageReactionsComponent/)) * */ messageReactionsTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display the reactions of a [message](/chat/docs/sdk/angular/components/MessageComponent/), and the selector to add a reaction to a message (instead of the [default message reactions component](/chat/docs/sdk/angular/components/MessageReactionsComponent/)) + * The template used to display the reactions of a [message](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/), and the selector to add a reaction to a message (instead of the [default message reactions component](/chat/docs/sdk/angular/v6-rc/components/MessageReactionsComponent/)) * */ messageReactionsSelectorTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display a modal window (instead of the [default modal](/chat/docs/sdk/angular/components/ModalComponent/)) + * The template used to display a modal window (instead of the [default modal](/chat/docs/sdk/angular/v6-rc/components/ModalComponent/)) * */ modalTemplate$ = new BehaviorSubject | undefined>( undefined ); /** - * The template used to override the [default notification component](/chat/docs/sdk/angular/components/NotificationComponent/) + * The template used to override the [default notification component](/chat/docs/sdk/angular/v6-rc/components/NotificationComponent/) * */ notificationTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used for header of a [thread](/chat/docs/sdk/angular/components/ThreadComponent/) + * The template used for header of a [thread](/chat/docs/sdk/angular/v6-rc/components/ThreadComponent/) * */ threadHeaderTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used for displaying the delivered state of the message inside the [message component](/chat/docs/sdk/angular/components/MessageComponent/) + * The template used for displaying the delivered state of the message inside the [message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) * * Displayed for the last message sent by the current user, if the message isn't yet read by anyone * @@ -198,7 +198,7 @@ export class CustomTemplatesService { TemplateRef | undefined >(undefined); /** - * The template used for displaying the sending state of the message inside the [message component](/chat/docs/sdk/angular/components/MessageComponent/) + * The template used for displaying the sending state of the message inside the [message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) * * Displayed for the last message sent by the current user, if the message is currently being sent * @@ -207,7 +207,7 @@ export class CustomTemplatesService { TemplateRef | undefined >(undefined); /** - * The template used for displaying the sent state of the message inside the [message component](/chat/docs/sdk/angular/components/MessageComponent/) + * The template used for displaying the sent state of the message inside the [message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) * * Displayed for the last message sent by the current user, if the message is read at least by one user * @@ -216,82 +216,82 @@ export class CustomTemplatesService { TemplateRef | undefined >(undefined); /** - * Template to display custom metadata inside [message component](/chat/docs/sdk/angular/components/MessageComponent/) + * Template to display custom metadata inside [message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) * */ customMessageMetadataTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display additional information about a channel under the channel name inside the [channel header component](/chat/docs/sdk/angular/components/ChannelHeaderComponent/) + * The template used to display additional information about a channel under the channel name inside the [channel header component](/chat/docs/sdk/angular/v6-rc/components/ChannelHeaderComponent/) * */ channelHeaderInfoTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used for displaying file upload/attachment selector inside the [message input](/chat/docs/sdk/angular/components/MessageInputComponent/) + * The template used for displaying file upload/attachment selector inside the [message input](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent/) * */ customAttachmentUploadTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template that can be used to override how a single image attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/) + * The template that can be used to override how a single image attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/v6-rc/components/AttachmentListComponent/) */ imageAttachmentTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template that can be used to override how a voice recording attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/), by default the [voice recording component](/chat/docs/sdk/angular/components/VoiceRecordingComponent/) is used + * The template that can be used to override how a voice recording attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/v6-rc/components/AttachmentListComponent/), by default the [voice recording component](/chat/docs/sdk/angular/v6-rc/components/VoiceRecordingComponent/) is used */ voiceRecordingAttachmentTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template that can be used to override how a video attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/) + * The template that can be used to override how a video attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/v6-rc/components/AttachmentListComponent/) */ videoAttachmentTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template that can be used to override how image gallery is displayed inside the [attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/) + * The template that can be used to override how image gallery is displayed inside the [attachment list](/chat/docs/sdk/angular/v6-rc/components/AttachmentListComponent/) */ galleryAttachmentTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template that can be used to override how a file attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/) + * The template that can be used to override how a file attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/v6-rc/components/AttachmentListComponent/) */ fileAttachmentTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template that can be used to override how a card attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/) + * The template that can be used to override how a card attachment is displayed inside the [attachment list](/chat/docs/sdk/angular/v6-rc/components/AttachmentListComponent/) */ cardAttachmentTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template that can be used to override how attachment actions are displayed inside the [attachment list](/chat/docs/sdk/angular/components/AttachmentListComponent/) + * The template that can be used to override how attachment actions are displayed inside the [attachment list](/chat/docs/sdk/angular/v6-rc/components/AttachmentListComponent/) */ attachmentActionsTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display [system messages](/chat/docs/javascript/silent_messages/) indise the [message component](/chat/docs/sdk/angular/components/MessageComponent/) + * The template used to display [system messages](/chat/docs/javascript/silent_messages/) indise the [message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) */ systemMessageTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display the date separator inside the [message list](/chat/docs/sdk/angular/components/MessageListComponent/) + * The template used to display the date separator inside the [message list](/chat/docs/sdk/angular/v6-rc/components/MessageListComponent/) */ dateSeparatorTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display unread messages indicator inside the [message list](/chat/docs/sdk/angular/components/MessageListComponent/) when the channel is opened + * The template used to display unread messages indicator inside the [message list](/chat/docs/sdk/angular/v6-rc/components/MessageListComponent/) when the channel is opened * * This UI element is used to separate unread messages from read messages */ @@ -299,7 +299,7 @@ export class CustomTemplatesService { TemplateRef | undefined >(undefined); /** - * The template used to display unread messages notification inside the [message list](/chat/docs/sdk/angular/components/MessageListComponent/) when the channel is opened + * The template used to display unread messages notification inside the [message list](/chat/docs/sdk/angular/v6-rc/components/MessageListComponent/) when the channel is opened * * Users can use this notification to jump to the first unread message when it's clicked */ @@ -319,38 +319,38 @@ export class CustomTemplatesService { TemplateRef | undefined >(undefined); /** - * The template used to display the [message bounce prompt](/chat/docs/sdk/angular/components/MessageBouncePromptComponent/) + * The template used to display the [message bounce prompt](/chat/docs/sdk/angular/v6-rc/components/MessageBouncePromptComponent/) */ messageBouncePromptTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * Template used to display the channel information inside the [channel list item](/chat/docs/sdk/angular/components/ChannelPreviewComponent/) + * Template used to display the channel information inside the [channel list item](/chat/docs/sdk/angular/v6-rc/components/ChannelPreviewComponent/) * */ channelPreviewInfoTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display custom attachment previews in the [message input component](/chat/docs/sdk/angular/components/MessageInputComponent/) + * The template used to display custom attachment previews in the [message input component](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent/) */ customAttachmentPreviewListTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display custom attachments in the [message component](/chat/docs/sdk/angular/components/MessageComponent/) + * The template used to display custom attachments in the [message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) */ customAttachmentListTemplate$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * The template used to display the number of thread replies inside the [message component](/chat/docs/sdk/angular/components/MessageComponent/) + * The template used to display the number of thread replies inside the [message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) */ threadLinkButton$ = new BehaviorSubject< TemplateRef | undefined >(undefined); /** - * Template to display custom metadata inside the message bubble of the [message component](/chat/docs/sdk/angular/components/MessageComponent/) + * Template to display custom metadata inside the message bubble of the [message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) * * To properly position your template you should override the `grid-template-areas` of the `.str-chat__message-inner` selector */ @@ -358,7 +358,7 @@ export class CustomTemplatesService { TemplateRef | undefined >(undefined); /** - * Template to display the text content inside the [message component](/chat/docs/sdk/angular/components/MessageComponent/). The default component is [stream-message-text](/chat/docs/sdk/angular/components/MessageTextComponent/) + * Template to display the text content inside the [message component](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/). The default component is [stream-message-text](/chat/docs/sdk/angular/v6-rc/components/MessageTextComponent/) */ messageTextTemplate$ = new BehaviorSubject< TemplateRef | undefined diff --git a/projects/stream-chat-angular/src/lib/icon/icon-placeholder/icon-placeholder.component.ts b/projects/stream-chat-angular/src/lib/icon/icon-placeholder/icon-placeholder.component.ts index b3b5e18c..43f0b508 100644 --- a/projects/stream-chat-angular/src/lib/icon/icon-placeholder/icon-placeholder.component.ts +++ b/projects/stream-chat-angular/src/lib/icon/icon-placeholder/icon-placeholder.component.ts @@ -4,7 +4,7 @@ import { IconContext } from '../../types'; import { CustomTemplatesService } from '../../custom-templates.service'; /** - * The `IconPlaceholder` component displays the [default icons](/chat/docs/sdk/angular/components/IconComponent/) unless a [custom template](/chat/docs/sdk/angular/services/CustomTemplatesService/) is provided. This component is used by the SDK internally, you likely won't need to use it. + * The `IconPlaceholder` component displays the [default icons](/chat/docs/sdk/angular/v6-rc/components/IconComponent/) unless a [custom template](/chat/docs/sdk/angular/v6-rc/services/CustomTemplatesService/) is provided. This component is used by the SDK internally, you likely won't need to use it. */ @Component({ selector: 'stream-icon-placeholder', diff --git a/projects/stream-chat-angular/src/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.ts b/projects/stream-chat-angular/src/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.ts index ada73f00..7a1501dc 100644 --- a/projects/stream-chat-angular/src/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.ts +++ b/projects/stream-chat-angular/src/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { CustomTemplatesService } from '../../custom-templates.service'; /** - * The `LoadingInficatorPlaceholder` component displays the [default loading indicator](/chat/docs/sdk/angular/components/LoadingIndicatorComponent/) unless a [custom template](/chat/docs/sdk/angular/services/CustomTemplatesService/) is provided. This component is used by the SDK internally, you likely won't need to use it. + * The `LoadingInficatorPlaceholder` component displays the [default loading indicator](/chat/docs/sdk/angular/v6-rc/components/LoadingIndicatorComponent/) unless a [custom template](/chat/docs/sdk/angular/v6-rc/services/CustomTemplatesService/) is provided. This component is used by the SDK internally, you likely won't need to use it. */ @Component({ selector: 'stream-loading-indicator-placeholder', diff --git a/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.ts b/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.ts index 3006b79a..4024a8b2 100644 --- a/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.ts +++ b/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.ts @@ -21,7 +21,7 @@ import { } from '../types'; import { MessageActionsService } from '../message-actions.service'; /** - * The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. You can find the [list of the supported actions](/chat/docs/sdk/angular/concepts/message-interactions/) in the message interaction guide. + * The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. You can find the [list of the supported actions](/chat/docs/sdk/angular/v6-rc/concepts/message-interactions/) in the message interaction guide. */ @Component({ selector: 'stream-message-actions-box', @@ -44,7 +44,7 @@ export class MessageActionsBoxComponent */ @Input() messageTextHtmlElement: HTMLElement | undefined; /** - * The list of [channel capabilities](/chat/docs/javascript/channel_capabilities/) that are enabled for the current user, the list of [supported interactions](/chat/docs/sdk/angular/concepts/message-interactions) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. + * The list of [channel capabilities](/chat/docs/javascript/channel_capabilities/) that are enabled for the current user, the list of [supported interactions](/chat/docs/sdk/angular/v6-rc/concepts/message-interactions) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. */ @Input() enabledActions: string[] = []; messageActionItemTemplate: diff --git a/projects/stream-chat-angular/src/lib/message-actions.service.ts b/projects/stream-chat-angular/src/lib/message-actions.service.ts index 9f38f5b5..a8bbf2fe 100644 --- a/projects/stream-chat-angular/src/lib/message-actions.service.ts +++ b/projects/stream-chat-angular/src/lib/message-actions.service.ts @@ -13,7 +13,7 @@ import { NotificationService } from './notification.service'; import { ChannelService } from './channel.service'; /** - * The message actions service provides customization options for the [message actions](/chat/docs/sdk/angular/components/MessageActionsBoxComponent) + * The message actions service provides customization options for the [message actions](/chat/docs/sdk/angular/v6-rc/components/MessageActionsBoxComponent) */ @Injectable({ providedIn: 'root', @@ -177,7 +177,7 @@ export class MessageActionsService { */ customActions$ = new BehaviorSubject([]); /** - * By default the [`MessageComponent`](/chat/docs/sdk/angular/components/MessageComponent/) will display the [`MessageActionsBoxComponent`](/chat/docs/sdk/angular/components/MessageActionsBoxComponent/). You can override that behavior by providing your own event handler. + * By default the [`MessageComponent`](/chat/docs/sdk/angular/v6-rc/components/MessageComponent/) will display the [`MessageActionsBoxComponent`](/chat/docs/sdk/angular/v6-rc/components/MessageActionsBoxComponent/). You can override that behavior by providing your own event handler. */ customActionClickHandler?: (details: MessageActionsClickDetails) => void; /** diff --git a/projects/stream-chat-angular/src/lib/message-bounce-prompt/message-bounce-prompt.component.ts b/projects/stream-chat-angular/src/lib/message-bounce-prompt/message-bounce-prompt.component.ts index 0f73e40d..bf8b8a52 100644 --- a/projects/stream-chat-angular/src/lib/message-bounce-prompt/message-bounce-prompt.component.ts +++ b/projects/stream-chat-angular/src/lib/message-bounce-prompt/message-bounce-prompt.component.ts @@ -6,7 +6,7 @@ import { MessageActionsService } from '../message-actions.service'; import { StreamMessage } from '../types'; /** - * The component watches for the [`channelService.bouncedMessage$` stream](/chat/docs/sdk/angular/services/ChannelService/#bouncedmessage) and opens the bounce modal if a message is emitted. + * The component watches for the [`channelService.bouncedMessage$` stream](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#bouncedmessage) and opens the bounce modal if a message is emitted. * * To bounce messages, you need to set up [semantic filters for moderation](https://getstream.io/automated-moderation/docs/automod_configuration/?q=semantic%20filters). */ diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts index 8b5517e8..07a3504b 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts @@ -31,7 +31,7 @@ import { CustomTemplatesService } from '../../custom-templates.service'; import { MessageInputConfigService } from '../message-input-config.service'; /** - * The `AutocompleteTextarea` component is used by the [`MessageInput`](/chat/docs/sdk/angular/components/MessageInputComponent/) component to display the input HTML element where users can type their message. + * The `AutocompleteTextarea` component is used by the [`MessageInput`](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent/) component to display the input HTML element where users can type their message. */ @Component({ selector: 'stream-autocomplete-textarea', @@ -52,15 +52,15 @@ export class AutocompleteTextareaComponent */ @Input() placeholder = ''; /** - * If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](/chat/docs/sdk/angular/components/MessageInputComponent/#inputs-and-outputs/) component. + * If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent/#inputs-and-outputs/) component. */ @Input() areMentionsEnabled: boolean | undefined = true; /** - * See [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService) for more information + * See [`MessageInputConfigService`](/chat/docs/sdk/angular/v6-rc/services/MessageInputConfigService) for more information */ @Input() inputMode!: 'desktop' | 'mobile'; /** - * The scope for user mentions, either members of the current channel of members of the application. You can also set this input on the [`MessageInput`](/chat/docs/sdk/angular/components/MessageInputComponent/#inputs-and-outputs) component. + * The scope for user mentions, either members of the current channel of members of the application. You can also set this input on the [`MessageInput`](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent/#inputs-and-outputs) component. */ @Input() mentionScope: 'channel' | 'application' = 'channel'; /** diff --git a/projects/stream-chat-angular/src/lib/message-input/emoji-input.service.ts b/projects/stream-chat-angular/src/lib/message-input/emoji-input.service.ts index dd3ac0be..422b3f48 100644 --- a/projects/stream-chat-angular/src/lib/message-input/emoji-input.service.ts +++ b/projects/stream-chat-angular/src/lib/message-input/emoji-input.service.ts @@ -2,14 +2,14 @@ import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; /** - * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this service, more info can be found in [custom emoji picker guide](/chat/docs/sdk/angular/code-examples/emoji-picker/) + * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this service, more info can be found in [custom emoji picker guide](/chat/docs/sdk/angular/v6-rc/code-examples/emoji-picker/) */ @Injectable({ providedIn: 'root', }) export class EmojiInputService { /** - * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this Subject, more info can be found in [custom emoji picker guide](/chat/docs/sdk/angular/code-examples/emoji-picker/) + * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this Subject, more info can be found in [custom emoji picker guide](/chat/docs/sdk/angular/v6-rc/code-examples/emoji-picker/) */ emojiInput$ = new Subject(); diff --git a/projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts b/projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts index 1d1734d6..2e600600 100644 --- a/projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts +++ b/projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts @@ -4,7 +4,7 @@ import { BehaviorSubject } from 'rxjs'; import { CustomAutocomplete } from '../types'; /** - * The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](/chat/docs/sdk/angular/components/MessageInputComponent/) components if your UI has more than one input component. + * The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent/) components if your UI has more than one input component. */ @Injectable({ providedIn: 'root', @@ -15,7 +15,7 @@ export class MessageInputConfigService { */ isFileUploadEnabled: boolean | undefined = true; /** - * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](/chat/docs/sdk/angular/concepts/opt-in-architecture/) for this feature to work. + * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](/chat/docs/sdk/angular/v6-rc/concepts/opt-in-architecture/) for this feature to work. */ areMentionsEnabled: boolean | undefined = true; /** @@ -38,7 +38,7 @@ export class MessageInputConfigService { /** * Override the message input's default event handler for [paste events](https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event) * - * The event handler will receive the event object, and the [message input component](/chat/docs/sdk/angular/components/MessageInputComponent). + * The event handler will receive the event object, and the [message input component](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent). * * You can use the public API of the message input component to update the composer. Typically you want to update the message text and/or attachments, this is how you can do these: * - Change message text: `inputComponent.textareaValue = ''` diff --git a/projects/stream-chat-angular/src/lib/message-input/message-input.component.ts b/projects/stream-chat-angular/src/lib/message-input/message-input.component.ts index c67cf21f..bdbcd7c3 100644 --- a/projects/stream-chat-angular/src/lib/message-input/message-input.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/message-input.component.ts @@ -59,15 +59,15 @@ export class MessageInputComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit { /** - * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](/chat/docs/javascript/channel_capabilities/). If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). + * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](/chat/docs/javascript/channel_capabilities/). If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/v6-rc/services/MessageInputConfigService/). */ @Input() isFileUploadEnabled: boolean | undefined; /** - * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](/chat/docs/sdk/angular/concepts/opt-in-architecture/) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). + * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](/chat/docs/sdk/angular/v6-rc/concepts/opt-in-architecture/) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/v6-rc/services/MessageInputConfigService/). */ @Input() areMentionsEnabled: boolean | undefined; /** - * The scope for user mentions, either members of the current channel of members of the application. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). + * The scope for user mentions, either members of the current channel of members of the application. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/v6-rc/services/MessageInputConfigService/). */ @Input() mentionScope: 'channel' | 'application' | undefined; /** @@ -75,7 +75,7 @@ export class MessageInputComponent */ @Input() mode: 'thread' | 'main' = 'main'; /** - * If true, users can select multiple files to upload. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). + * If true, users can select multiple files to upload. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/v6-rc/services/MessageInputConfigService/). */ @Input() isMultipleFileUploadEnabled: boolean | undefined; /** @@ -87,7 +87,7 @@ export class MessageInputComponent */ @Input() sendMessage$: Observable | undefined; /** - * In `desktop` mode the `Enter` key will trigger message sending, in `mobile` mode the `Enter` key will insert a new line to the message input. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). + * In `desktop` mode the `Enter` key will trigger message sending, in `mobile` mode the `Enter` key will insert a new line to the message input. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/v6-rc/services/MessageInputConfigService/). */ @Input() inputMode: 'desktop' | 'mobile'; /** @@ -95,7 +95,7 @@ export class MessageInputComponent */ @Input() autoFocus = true; /** - * By default the input will react to changes in `messageToEdit$` from [`MessageActionsService`](/chat/docs/sdk/angular/services/MessageActionsService/) and display the message to be edited (taking into account the current `mode`). + * By default the input will react to changes in `messageToEdit$` from [`MessageActionsService`](/chat/docs/sdk/angular/v6-rc/services/MessageActionsService/) and display the message to be edited (taking into account the current `mode`). * * If you don't need that behavior, you can turn this of with this flag. In that case you should create your own edit message UI. */ diff --git a/projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts index 0794d1f7..8ac4204e 100644 --- a/projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts @@ -17,7 +17,7 @@ import { TextareaInterface } from '../textarea.interface'; import { UserResponse } from 'stream-chat'; /** - * The `Textarea` component is used by the [`MessageInput`](/chat/docs/sdk/angular/components/MessageInputComponent/) component to display the input HTML element where users can type their message. + * The `Textarea` component is used by the [`MessageInput`](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent/) component to display the input HTML element where users can type their message. */ @Component({ selector: 'stream-textarea', @@ -38,7 +38,7 @@ export class TextareaComponent */ @Input() placeholder = ''; /** - * See [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService) for more information + * See [`MessageInputConfigService`](/chat/docs/sdk/angular/v6-rc/services/MessageInputConfigService) for more information */ @Input() inputMode!: 'desktop' | 'mobile'; /** diff --git a/projects/stream-chat-angular/src/lib/message-reactions-selector/message-reactions-selector.component.ts b/projects/stream-chat-angular/src/lib/message-reactions-selector/message-reactions-selector.component.ts index f223994a..6a67b46b 100644 --- a/projects/stream-chat-angular/src/lib/message-reactions-selector/message-reactions-selector.component.ts +++ b/projects/stream-chat-angular/src/lib/message-reactions-selector/message-reactions-selector.component.ts @@ -13,7 +13,7 @@ import { MessageReactionsService } from '../message-reactions.service'; import { Subscription } from 'rxjs'; /** - * The `MessageReactionsSelectorComponent` makes it possible for users to react to a message, the reaction options can be set using the [`MessageReactionsService`](/chat/docs/sdk/angular/services/MessageReactionsService/). You can read more about [message reactions](/chat/docs/javascript/send_reaction/) in the platform documentation. + * The `MessageReactionsSelectorComponent` makes it possible for users to react to a message, the reaction options can be set using the [`MessageReactionsService`](/chat/docs/sdk/angular/v6-rc/services/MessageReactionsService/). You can read more about [message reactions](/chat/docs/javascript/send_reaction/) in the platform documentation. */ @Component({ selector: 'stream-message-reactions-selector', @@ -24,7 +24,7 @@ export class MessageReactionsSelectorComponent implements OnInit, OnDestroy, AfterViewInit { /** - * List of the user's own reactions of a [message](/chat/docs/sdk/angular/types/stream-message/), used to display the users of a reaction type. + * List of the user's own reactions of a [message](/chat/docs/sdk/angular/v6-rc/types/stream-message/), used to display the users of a reaction type. */ @Input() ownReactions: ReactionResponse[] = []; /** diff --git a/projects/stream-chat-angular/src/lib/message-reactions.service.ts b/projects/stream-chat-angular/src/lib/message-reactions.service.ts index 5fd4edf0..c6fcbc1c 100644 --- a/projects/stream-chat-angular/src/lib/message-reactions.service.ts +++ b/projects/stream-chat-angular/src/lib/message-reactions.service.ts @@ -15,7 +15,7 @@ export class MessageReactionsService { /** * The enabled [reactions](/chat/docs/javascript/send_reaction/) and the associated emoji * - * You can provide any string as a reaction. The emoji can be provided as a string, if you want to use custom images for reactions you have to provide a [custom reactions UI](/chat/docs/sdk/angular/services/CustomTemplatesService/#messagereactionstemplate/) + * You can provide any string as a reaction. The emoji can be provided as a string, if you want to use custom images for reactions you have to provide a [custom reactions UI](/chat/docs/sdk/angular/v6-rc/services/CustomTemplatesService/#messagereactionstemplate/) */ reactions$ = new BehaviorSubject<{ [key in MessageReactionType]: string }>({ haha: '😂', @@ -25,9 +25,9 @@ export class MessageReactionsService { wow: '😮', }); /** - * By default the [`MessageReactionsComponent`](/chat/docs/sdk/angular/components/MessageReactionsComponent/) will display the reacting users when a reaction is clicked. You can override this with your own UI by providing a custom event handler. + * By default the [`MessageReactionsComponent`](/chat/docs/sdk/angular/v6-rc/components/MessageReactionsComponent/) will display the reacting users when a reaction is clicked. You can override this with your own UI by providing a custom event handler. * - * The event handler can retrieve all reactions of a message using the [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/services/MessageReactionsService/#queryreactions) + * The event handler can retrieve all reactions of a message using the [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/v6-rc/services/MessageReactionsService/#queryreactions) */ customReactionClickHandler?: (details: MessageReactionClickDetails) => void; diff --git a/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts b/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts index 559b8b4f..fa7e1930 100644 --- a/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts +++ b/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts @@ -47,12 +47,12 @@ export class MessageReactionsComponent @Input() messageReactionCounts: { [key in MessageReactionType]?: number } = {}; /** - * List of reactions of a [message](/chat/docs/sdk/angular/types/stream-message/), used to display the users of a reaction type. - * @deprecated you can fetch the reactions using [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/services/MessageReactionsService/#queryreactions) + * List of reactions of a [message](/chat/docs/sdk/angular/v6-rc/types/stream-message/), used to display the users of a reaction type. + * @deprecated you can fetch the reactions using [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/v6-rc/services/MessageReactionsService/#queryreactions) */ @Input() latestReactions: ReactionResponse[] = []; /** - * List of the user's own reactions of a [message](/chat/docs/sdk/angular/types/stream-message/), used to display the users of a reaction type. + * List of the user's own reactions of a [message](/chat/docs/sdk/angular/v6-rc/types/stream-message/), used to display the users of a reaction type. */ @Input() ownReactions: ReactionResponse[] = []; @ViewChild('selectorContainer') private selectorContainer: diff --git a/projects/stream-chat-angular/src/lib/message.service.ts b/projects/stream-chat-angular/src/lib/message.service.ts index 5fe08edd..6b61fda1 100644 --- a/projects/stream-chat-angular/src/lib/message.service.ts +++ b/projects/stream-chat-angular/src/lib/message.service.ts @@ -12,7 +12,7 @@ export class MessageService { * Decides if the message content should be formatted as text or HTML * * If you display messages as text the following parts are still be displayed as HTML: - * - user mentions -> you can customize this with your own template using the [`customTemplatesService.mentionTemplate$`](/chat/docs/sdk/angular/services/CustomTemplatesService/#mentiontemplate) + * - user mentions -> you can customize this with your own template using the [`customTemplatesService.mentionTemplate$`](/chat/docs/sdk/angular/v6-rc/services/CustomTemplatesService/#mentiontemplate) * - links -> you can customize this by providing you own [`customLinkRenderer`](#customlinkrenderer) method */ displayAs: 'text' | 'html' = 'text'; diff --git a/projects/stream-chat-angular/src/lib/message/message.component.ts b/projects/stream-chat-angular/src/lib/message/message.component.ts index f08b97c6..49a6246f 100644 --- a/projects/stream-chat-angular/src/lib/message/message.component.ts +++ b/projects/stream-chat-angular/src/lib/message/message.component.ts @@ -40,7 +40,7 @@ import { TranslateService } from '@ngx-translate/core'; import { isSafari } from '../is-safari'; /** - * The `Message` component displays a message with additional information such as sender and date, and enables [interaction with the message (i.e. edit or react)](/chat/docs/sdk/angular/concepts/message-interactions/). + * The `Message` component displays a message with additional information such as sender and date, and enables [interaction with the message (i.e. edit or react)](/chat/docs/sdk/angular/v6-rc/concepts/message-interactions/). */ @Component({ selector: 'stream-message', @@ -56,7 +56,7 @@ export class MessageComponent */ @Input() message: StreamMessage | undefined; /** - * The list of [channel capabilities](/chat/docs/javascript/channel_capabilities/) that are enabled for the current user, the list of [supported interactions](/chat/docs/sdk/angular/concepts/message-interactions/) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. The [`MessageList`](/chat/docs/sdk/angular/components/MessageListComponent/) component automatically sets this based on [channel capabilities](/chat/docs/javascript/channel_capabilities/). + * The list of [channel capabilities](/chat/docs/javascript/channel_capabilities/) that are enabled for the current user, the list of [supported interactions](/chat/docs/sdk/angular/v6-rc/concepts/message-interactions/) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. The [`MessageList`](/chat/docs/sdk/angular/v6-rc/components/MessageListComponent/) component automatically sets this based on [channel capabilities](/chat/docs/javascript/channel_capabilities/). */ @Input() enabledMessageActions: string[] = []; /** diff --git a/projects/stream-chat-angular/src/lib/notification.service.ts b/projects/stream-chat-angular/src/lib/notification.service.ts index 14b1562f..0b730ccd 100644 --- a/projects/stream-chat-angular/src/lib/notification.service.ts +++ b/projects/stream-chat-angular/src/lib/notification.service.ts @@ -3,7 +3,7 @@ import { BehaviorSubject, Observable } from 'rxjs'; import { NotificationPayload, NotificationType } from './types'; /** - * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](/chat/docs/sdk/angular/components/NotificationListComponent/) component displays the currently active notifications. + * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](/chat/docs/sdk/angular/v6-rc/components/NotificationListComponent/) component displays the currently active notifications. */ @Injectable({ providedIn: 'root', diff --git a/projects/stream-chat-angular/src/lib/notification/notification.component.ts b/projects/stream-chat-angular/src/lib/notification/notification.component.ts index 1bb9f94a..b6a1d36e 100644 --- a/projects/stream-chat-angular/src/lib/notification/notification.component.ts +++ b/projects/stream-chat-angular/src/lib/notification/notification.component.ts @@ -2,7 +2,7 @@ import { Component, Input, TemplateRef } from '@angular/core'; import { NotificationType } from '../types'; /** - * The `Notification` component displays a notification within the [`NotificationList`](/chat/docs/sdk/angular/components/NotificationListComponent/) + * The `Notification` component displays a notification within the [`NotificationList`](/chat/docs/sdk/angular/v6-rc/components/NotificationListComponent/) */ @Component({ selector: 'stream-notification', diff --git a/projects/stream-chat-angular/src/lib/stream-i18n.service.ts b/projects/stream-chat-angular/src/lib/stream-i18n.service.ts index 348cbc8b..3828f1ed 100644 --- a/projects/stream-chat-angular/src/lib/stream-i18n.service.ts +++ b/projects/stream-chat-angular/src/lib/stream-i18n.service.ts @@ -3,7 +3,7 @@ import { TranslateService } from '@ngx-translate/core'; import { en } from '../assets/i18n/en'; /** - * The `StreamI18nService` can be used to customize the labels of the chat UI. Our [translation guide](/chat/docs/sdk/angular/concepts/translation/) covers this topic in detail. + * The `StreamI18nService` can be used to customize the labels of the chat UI. Our [translation guide](/chat/docs/sdk/angular/v6-rc/concepts/translation/) covers this topic in detail. */ @Injectable({ providedIn: 'root', diff --git a/projects/stream-chat-angular/src/lib/theme.service.ts b/projects/stream-chat-angular/src/lib/theme.service.ts index e0862070..df12d8ce 100644 --- a/projects/stream-chat-angular/src/lib/theme.service.ts +++ b/projects/stream-chat-angular/src/lib/theme.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; /** - * The `ThemeService` can be used to change the theme of the chat UI and to customize the theme. Our [theming guide](/chat/docs/sdk/angular/theming/themingv2/) gives a complete overview about the topic. + * The `ThemeService` can be used to change the theme of the chat UI and to customize the theme. Our [theming guide](/chat/docs/sdk/angular/v6-rc/theming/themingv2/) gives a complete overview about the topic. */ @Injectable({ providedIn: 'root', diff --git a/projects/stream-chat-angular/src/lib/thread/thread.component.ts b/projects/stream-chat-angular/src/lib/thread/thread.component.ts index 1de0b14a..ed540463 100644 --- a/projects/stream-chat-angular/src/lib/thread/thread.component.ts +++ b/projects/stream-chat-angular/src/lib/thread/thread.component.ts @@ -8,7 +8,7 @@ import { getChannelDisplayText } from '../get-channel-display-text'; import { StreamMessage, ThreadHeaderContext } from '../types'; /** - * The `Thread` component represents a [message thread](/chat/docs/javascript/threads/), it is a container component that displays a thread with a header, [`MessageList`](/chat/docs/sdk/angular/components/MessageListComponent) and [`MessageInput`](/chat/docs/sdk/angular/components/MessageInputComponent/) components. + * The `Thread` component represents a [message thread](/chat/docs/javascript/threads/), it is a container component that displays a thread with a header, [`MessageList`](/chat/docs/sdk/angular/v6-rc/components/MessageListComponent) and [`MessageInput`](/chat/docs/sdk/angular/v6-rc/components/MessageInputComponent/) components. */ @Component({ selector: 'stream-thread', From 658cca3fe9734404f3c5dacdacb87946c3a24fcc Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Mon, 10 Mar 2025 10:15:52 +0100 Subject: [PATCH 10/17] fix: remove x-stream-client compatibility code --- .../src/lib/chat-client.service.ts | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/projects/stream-chat-angular/src/lib/chat-client.service.ts b/projects/stream-chat-angular/src/lib/chat-client.service.ts index 0c84ca3d..8debe3c2 100644 --- a/projects/stream-chat-angular/src/lib/chat-client.service.ts +++ b/projects/stream-chat-angular/src/lib/chat-client.service.ts @@ -105,22 +105,10 @@ export class ChatClientService { this.trackPendingChannelInvites = clientOptions?.trackPendingChannelInvites === true; this.chatClient = StreamChat.getInstance(apiKey, clientOptions); - if ('sdkIdentifier' in this.chatClient) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access - (this.chatClient as any).sdkIdentifier = { - name: 'angular', - version, - }; - } else { - const userAgent = this.chatClient.getUserAgent(); - if (!userAgent.includes('stream-chat-angular')) { - const parts = userAgent.split('-'); - const jsVersion = parts[parts.length - 1] ?? '0.0.0'; - this.chatClient.setUserAgent( - `stream-chat-angular-v${version}-llc-v${jsVersion}` - ); - } - } + this.chatClient.sdkIdentifier = { + name: 'angular', + version, + }; this.chatClient.recoverStateOnReconnect = false; this.chatClient.devToken; let result; From 0c4ded44b9a311f1d8ee6f04b6b903364391325a Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 10 Mar 2025 09:18:46 +0000 Subject: [PATCH 11/17] chore(release): 6.0.0-rc.2 [skip ci] # [6.0.0-rc.2](https://github.com/GetStream/stream-chat-angular/compare/v6.0.0-rc.1...v6.0.0-rc.2) (2025-03-10) ### Bug Fixes * remove x-stream-client compatibility code ([658cca3](https://github.com/GetStream/stream-chat-angular/commit/658cca3fe9734404f3c5dacdacb87946c3a24fcc)) --- projects/stream-chat-angular/package.json | 2 +- projects/stream-chat-angular/src/assets/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index c16f82e1..5710b8ac 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -1,6 +1,6 @@ { "name": "stream-chat-angular", - "version": "6.0.0-rc.1", + "version": "6.0.0-rc.2", "description": "Angular components to create chat conversations or livestream style chat", "author": "GetStream", "homepage": "https://getstream.io/chat/", diff --git a/projects/stream-chat-angular/src/assets/version.ts b/projects/stream-chat-angular/src/assets/version.ts index 891480c9..d1d1d77d 100644 --- a/projects/stream-chat-angular/src/assets/version.ts +++ b/projects/stream-chat-angular/src/assets/version.ts @@ -1 +1 @@ -export const version = '6.0.0-rc.1'; +export const version = '6.0.0-rc.2'; From 3999ce7ebdaa3379ae30e83579b93d93f7bcbb96 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 20 Mar 2025 13:01:26 +0000 Subject: [PATCH 12/17] chore(release): 6.0.0-rc.3 [skip ci] # [6.0.0-rc.3](https://github.com/GetStream/stream-chat-angular/compare/v6.0.0-rc.2...v6.0.0-rc.3) (2025-03-20) ### Bug Fixes * message menu reopened after adding reaction ([baa52b8](https://github.com/GetStream/stream-chat-angular/commit/baa52b8b0be1f55c393563b84f6a5070c4f2f679)) --- projects/stream-chat-angular/package.json | 2 +- projects/stream-chat-angular/src/assets/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index 5710b8ac..85bb7713 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -1,6 +1,6 @@ { "name": "stream-chat-angular", - "version": "6.0.0-rc.2", + "version": "6.0.0-rc.3", "description": "Angular components to create chat conversations or livestream style chat", "author": "GetStream", "homepage": "https://getstream.io/chat/", diff --git a/projects/stream-chat-angular/src/assets/version.ts b/projects/stream-chat-angular/src/assets/version.ts index d1d1d77d..3a263007 100644 --- a/projects/stream-chat-angular/src/assets/version.ts +++ b/projects/stream-chat-angular/src/assets/version.ts @@ -1 +1 @@ -export const version = '6.0.0-rc.2'; +export const version = '6.0.0-rc.3'; From 3e79600c418793edc7a04f05df902220abc20538 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 23 Apr 2025 14:34:20 +0000 Subject: [PATCH 13/17] chore(release): 6.0.0-rc.4 [skip ci] # [6.0.0-rc.4](https://github.com/GetStream/stream-chat-angular/compare/v6.0.0-rc.3...v6.0.0-rc.4) (2025-04-23) ### Features * display message blocked component when message is blocked by moderation ([f0f9b00](https://github.com/GetStream/stream-chat-angular/commit/f0f9b0008962c6512d16e58dd74c4dac58a9bef7)) --- projects/stream-chat-angular/package.json | 2 +- projects/stream-chat-angular/src/assets/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index 85bb7713..01833780 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -1,6 +1,6 @@ { "name": "stream-chat-angular", - "version": "6.0.0-rc.3", + "version": "6.0.0-rc.4", "description": "Angular components to create chat conversations or livestream style chat", "author": "GetStream", "homepage": "https://getstream.io/chat/", diff --git a/projects/stream-chat-angular/src/assets/version.ts b/projects/stream-chat-angular/src/assets/version.ts index 3a263007..cd79028f 100644 --- a/projects/stream-chat-angular/src/assets/version.ts +++ b/projects/stream-chat-angular/src/assets/version.ts @@ -1 +1 @@ -export const version = '6.0.0-rc.3'; +export const version = '6.0.0-rc.4'; From c6dfd6cfdf1af1d1298bce04938f697b3785e460 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Tue, 29 Apr 2025 09:43:39 +0200 Subject: [PATCH 14/17] feat: integrate stream-chat@rc13 --- package-lock.json | 27 ++++++++++++++----- package.json | 2 +- .../src/lib/channel.service.ts | 4 +-- .../src/lib/get-message-translation.ts | 2 +- .../message-actions-box.component.spec.ts | 4 +-- .../src/lib/message/message.component.spec.ts | 4 +-- .../src/lib/types-custom.ts | 1 + 7 files changed, 29 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 04be9e05..5f89233f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "replace": "^1.2.2", "rxjs": "~7.4.0", "starwars-names": "^1.6.0", - "stream-chat": "9.0.0-rc.6", + "stream-chat": "9.0.0-rc.13", "ts-node": "^10.9.2", "tslib": "^2.3.0", "uuid": "^9.0.1", @@ -14049,6 +14049,12 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "node_modules/linkifyjs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.2.0.tgz", + "integrity": "sha512-pCj3PrQyATaoTYKHrgWRF3SJwsm61udVh+vuls/Rl6SptiDhgE7ziUIudAedRY9QEfynmM7/RmLEfPUyw1HPCw==", + "license": "MIT" + }, "node_modules/lint-staged": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-11.1.2.tgz", @@ -22316,9 +22322,9 @@ } }, "node_modules/stream-chat": { - "version": "9.0.0-rc.6", - "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.6.tgz", - "integrity": "sha512-z4l1ngKMPCuOhSopFY+SFhBNWN8lr85IXBP2Ob2eNIC+6AE3CQ0ofc16O0h6Jk3bKLzY+EL7//XuPAbqPkoRiA==", + "version": "9.0.0-rc.13", + "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.13.tgz", + "integrity": "sha512-qJPcHsQUfu0qMb7p7Bv9OnL6qID/qxYLKOIsG6KbUNEQHwkKSw/aDwExpvgJR7dXsUOLyLZFhVtYnFkAPDdJ3A==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@types/jsonwebtoken": "^9.0.8", @@ -22328,6 +22334,7 @@ "form-data": "^4.0.0", "isomorphic-ws": "^5.0.0", "jsonwebtoken": "^9.0.2", + "linkifyjs": "^4.2.0", "ws": "^8.18.1" }, "engines": { @@ -34401,6 +34408,11 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "linkifyjs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.2.0.tgz", + "integrity": "sha512-pCj3PrQyATaoTYKHrgWRF3SJwsm61udVh+vuls/Rl6SptiDhgE7ziUIudAedRY9QEfynmM7/RmLEfPUyw1HPCw==" + }, "lint-staged": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-11.1.2.tgz", @@ -40363,9 +40375,9 @@ } }, "stream-chat": { - "version": "9.0.0-rc.6", - "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.6.tgz", - "integrity": "sha512-z4l1ngKMPCuOhSopFY+SFhBNWN8lr85IXBP2Ob2eNIC+6AE3CQ0ofc16O0h6Jk3bKLzY+EL7//XuPAbqPkoRiA==", + "version": "9.0.0-rc.13", + "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.13.tgz", + "integrity": "sha512-qJPcHsQUfu0qMb7p7Bv9OnL6qID/qxYLKOIsG6KbUNEQHwkKSw/aDwExpvgJR7dXsUOLyLZFhVtYnFkAPDdJ3A==", "requires": { "@types/jsonwebtoken": "^9.0.8", "@types/ws": "^8.5.14", @@ -40374,6 +40386,7 @@ "form-data": "^4.0.0", "isomorphic-ws": "^5.0.0", "jsonwebtoken": "^9.0.2", + "linkifyjs": "^4.2.0", "ws": "^8.18.1" }, "dependencies": { diff --git a/package.json b/package.json index 17495880..9b9cb037 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "replace": "^1.2.2", "rxjs": "~7.4.0", "starwars-names": "^1.6.0", - "stream-chat": "9.0.0-rc.6", + "stream-chat": "9.0.0-rc.13", "ts-node": "^10.9.2", "tslib": "^2.3.0", "uuid": "^9.0.1", diff --git a/projects/stream-chat-angular/src/lib/channel.service.ts b/projects/stream-chat-angular/src/lib/channel.service.ts index 785b21d6..ea338366 100644 --- a/projects/stream-chat-angular/src/lib/channel.service.ts +++ b/projects/stream-chat-angular/src/lib/channel.service.ts @@ -19,11 +19,11 @@ import { Event, EventTypes, FormatMessageResponse, + LocalMessage, MemberFilters, Message, MessageResponse, ReactionResponse, - UpdatedMessage, UserResponse, } from 'stream-chat'; import { ChatClientService, ClientEvent } from './chat-client.service'; @@ -915,7 +915,7 @@ export class ChannelService { return this.resendMessage(message); } const response = await this.chatClientService.chatClient.updateMessage( - messageToUpdate as unknown as UpdatedMessage + messageToUpdate as unknown as LocalMessage ); const channel = this.channelsSubject diff --git a/projects/stream-chat-angular/src/lib/get-message-translation.ts b/projects/stream-chat-angular/src/lib/get-message-translation.ts index f09ae2d6..ec791a59 100644 --- a/projects/stream-chat-angular/src/lib/get-message-translation.ts +++ b/projects/stream-chat-angular/src/lib/get-message-translation.ts @@ -17,7 +17,7 @@ export const getMessageTranslation = ( (channel?.data?.auto_translation_language as TranslationLanguages); if (language && message?.i18n && message?.user?.id !== user?.id) { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-base-to-string - return message.i18n[`${language}_text` as `${TranslationLanguages}_text`]; + return message.i18n[`${language}_text`]; } else { return undefined; } diff --git a/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.spec.ts b/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.spec.ts index 601392eb..f27161a3 100644 --- a/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.spec.ts @@ -7,7 +7,7 @@ import { } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, of } from 'rxjs'; -import { Channel, MessageResponseBase, ReactionResponse } from 'stream-chat'; +import { Channel, ReactionResponse } from 'stream-chat'; import { TextareaComponent } from '../message-input/textarea/textarea.component'; import { ChannelService } from '../channel.service'; import { ChatClientService } from '../chat-client.service'; @@ -189,7 +189,7 @@ describe('MessageActionsBoxComponent', () => { it(`shouldn't disable quote action, if message already has a quoted message`, () => { component.message = { ...component.message!, - quoted_message: mockMessage() as any as MessageResponseBase, + quoted_message: mockMessage() as any, }; component.enabledActions = ['quote-message']; component.ngOnChanges({ diff --git a/projects/stream-chat-angular/src/lib/message/message.component.spec.ts b/projects/stream-chat-angular/src/lib/message/message.component.spec.ts index 11b1c87e..5067e0d2 100644 --- a/projects/stream-chat-angular/src/lib/message/message.component.spec.ts +++ b/projects/stream-chat-angular/src/lib/message/message.component.spec.ts @@ -5,7 +5,7 @@ import { tick, } from '@angular/core/testing'; -import { MessageResponseBase, UserResponse } from 'stream-chat'; +import { UserResponse } from 'stream-chat'; import { StreamMessage } from '../types'; import { LoadingIndicatorComponent } from '../icon/loading-indicator/loading-indicator.component'; import { MessageComponent } from './message.component'; @@ -885,7 +885,7 @@ describe('MessageComponent', () => { quotedMessage.text = 'This message was quoted'; component.message = { ...component.message!, - quoted_message: quotedMessage as any as MessageResponseBase, + quoted_message: quotedMessage as any, }; component.ngOnChanges({ message: {} as SimpleChange }); fixture.detectChanges(); diff --git a/projects/stream-chat-angular/src/lib/types-custom.ts b/projects/stream-chat-angular/src/lib/types-custom.ts index 81267bd0..11427ee5 100644 --- a/projects/stream-chat-angular/src/lib/types-custom.ts +++ b/projects/stream-chat-angular/src/lib/types-custom.ts @@ -1,5 +1,6 @@ export interface DefaultChannelData { image?: string; + name?: string; } export interface DefaultAttachmentData { From 17d6918296a5f4d83f89688cbb1020b3e3d58915 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 29 Apr 2025 07:46:22 +0000 Subject: [PATCH 15/17] chore(release): 6.0.0-rc.5 [skip ci] # [6.0.0-rc.5](https://github.com/GetStream/stream-chat-angular/compare/v6.0.0-rc.4...v6.0.0-rc.5) (2025-04-29) ### Features * integrate stream-chat@rc13 ([c6dfd6c](https://github.com/GetStream/stream-chat-angular/commit/c6dfd6cfdf1af1d1298bce04938f697b3785e460)) --- projects/stream-chat-angular/package.json | 2 +- projects/stream-chat-angular/src/assets/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index 01833780..cab8bc69 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -1,6 +1,6 @@ { "name": "stream-chat-angular", - "version": "6.0.0-rc.4", + "version": "6.0.0-rc.5", "description": "Angular components to create chat conversations or livestream style chat", "author": "GetStream", "homepage": "https://getstream.io/chat/", diff --git a/projects/stream-chat-angular/src/assets/version.ts b/projects/stream-chat-angular/src/assets/version.ts index cd79028f..46580622 100644 --- a/projects/stream-chat-angular/src/assets/version.ts +++ b/projects/stream-chat-angular/src/assets/version.ts @@ -1 +1 @@ -export const version = '6.0.0-rc.4'; +export const version = '6.0.0-rc.5'; From 588bd735d1897140677b10789442e23633001d58 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Wed, 30 Apr 2025 15:19:57 +0200 Subject: [PATCH 16/17] feat: update to latest stream-chat-js version --- package-lock.json | 14 +++++++------- package.json | 2 +- projects/stream-chat-angular/package.json | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f89233f..4f19da62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "replace": "^1.2.2", "rxjs": "~7.4.0", "starwars-names": "^1.6.0", - "stream-chat": "9.0.0-rc.13", + "stream-chat": "9.0.0-rc.15", "ts-node": "^10.9.2", "tslib": "^2.3.0", "uuid": "^9.0.1", @@ -22322,9 +22322,9 @@ } }, "node_modules/stream-chat": { - "version": "9.0.0-rc.13", - "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.13.tgz", - "integrity": "sha512-qJPcHsQUfu0qMb7p7Bv9OnL6qID/qxYLKOIsG6KbUNEQHwkKSw/aDwExpvgJR7dXsUOLyLZFhVtYnFkAPDdJ3A==", + "version": "9.0.0-rc.15", + "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.15.tgz", + "integrity": "sha512-n8IftP103jp8IVOUZA4mnOvEIbyzGTVjoL3rDm42apk8DRHz2/vdvgyTYUJysDNYh+Oxu5HwWObToKv1c/Bxdw==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@types/jsonwebtoken": "^9.0.8", @@ -40375,9 +40375,9 @@ } }, "stream-chat": { - "version": "9.0.0-rc.13", - "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.13.tgz", - "integrity": "sha512-qJPcHsQUfu0qMb7p7Bv9OnL6qID/qxYLKOIsG6KbUNEQHwkKSw/aDwExpvgJR7dXsUOLyLZFhVtYnFkAPDdJ3A==", + "version": "9.0.0-rc.15", + "resolved": "https://registry.npmjs.org/stream-chat/-/stream-chat-9.0.0-rc.15.tgz", + "integrity": "sha512-n8IftP103jp8IVOUZA4mnOvEIbyzGTVjoL3rDm42apk8DRHz2/vdvgyTYUJysDNYh+Oxu5HwWObToKv1c/Bxdw==", "requires": { "@types/jsonwebtoken": "^9.0.8", "@types/ws": "^8.5.14", diff --git a/package.json b/package.json index 9b9cb037..3d35d666 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "replace": "^1.2.2", "rxjs": "~7.4.0", "starwars-names": "^1.6.0", - "stream-chat": "9.0.0-rc.13", + "stream-chat": "9.0.0-rc.15", "ts-node": "^10.9.2", "tslib": "^2.3.0", "uuid": "^9.0.1", diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index cab8bc69..e2ee9bd2 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -22,7 +22,7 @@ "@breezystack/lamejs": "^1.2.7", "@ngx-translate/core": "^14.0.0 || ^15.0.0 || ^16.0.0", "rxjs": "^7.4.0", - "stream-chat": "9.0.0-rc.6" + "stream-chat": "9.0.0-rc.15" }, "peerDependenciesMeta": { "@breezystack/lamejs": { From b43103e40d957fed2e35759cac33c46c83a4076a Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 30 Apr 2025 13:23:22 +0000 Subject: [PATCH 17/17] chore(release): 6.0.0-rc.6 [skip ci] # [6.0.0-rc.6](https://github.com/GetStream/stream-chat-angular/compare/v6.0.0-rc.5...v6.0.0-rc.6) (2025-04-30) ### Features * update to latest stream-chat-js version ([588bd73](https://github.com/GetStream/stream-chat-angular/commit/588bd735d1897140677b10789442e23633001d58)) --- projects/stream-chat-angular/package.json | 2 +- projects/stream-chat-angular/src/assets/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/stream-chat-angular/package.json b/projects/stream-chat-angular/package.json index e2ee9bd2..83ed4ff4 100644 --- a/projects/stream-chat-angular/package.json +++ b/projects/stream-chat-angular/package.json @@ -1,6 +1,6 @@ { "name": "stream-chat-angular", - "version": "6.0.0-rc.5", + "version": "6.0.0-rc.6", "description": "Angular components to create chat conversations or livestream style chat", "author": "GetStream", "homepage": "https://getstream.io/chat/", diff --git a/projects/stream-chat-angular/src/assets/version.ts b/projects/stream-chat-angular/src/assets/version.ts index 46580622..a02d812f 100644 --- a/projects/stream-chat-angular/src/assets/version.ts +++ b/projects/stream-chat-angular/src/assets/version.ts @@ -1 +1 @@ -export const version = '6.0.0-rc.5'; +export const version = '6.0.0-rc.6';