@pubuduth-aplicy/chat-ui 2.1.62 → 2.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,50 +1,50 @@
1
- # React + TypeScript + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
-
14
- - Configure the top-level `parserOptions` property like this:
15
-
16
- ```js
17
- export default tseslint.config({
18
- languageOptions: {
19
- // other options...
20
- parserOptions: {
21
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
22
- tsconfigRootDir: import.meta.dirname,
23
- },
24
- },
25
- })
26
- ```
27
-
28
- - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29
- - Optionally add `...tseslint.configs.stylisticTypeChecked`
30
- - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31
-
32
- ```js
33
- // eslint.config.js
34
- import react from 'eslint-plugin-react'
35
-
36
- export default tseslint.config({
37
- // Set the react version
38
- settings: { react: { version: '18.3' } },
39
- plugins: {
40
- // Add the react plugin
41
- react,
42
- },
43
- rules: {
44
- // other rules...
45
- // Enable its recommended rules
46
- ...react.configs.recommended.rules,
47
- ...react.configs['jsx-runtime'].rules,
48
- },
49
- })
50
- ```
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
+
14
+ - Configure the top-level `parserOptions` property like this:
15
+
16
+ ```js
17
+ export default tseslint.config({
18
+ languageOptions: {
19
+ // other options...
20
+ parserOptions: {
21
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
22
+ tsconfigRootDir: import.meta.dirname,
23
+ },
24
+ },
25
+ })
26
+ ```
27
+
28
+ - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29
+ - Optionally add `...tseslint.configs.stylisticTypeChecked`
30
+ - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31
+
32
+ ```js
33
+ // eslint.config.js
34
+ import react from 'eslint-plugin-react'
35
+
36
+ export default tseslint.config({
37
+ // Set the react version
38
+ settings: { react: { version: '18.3' } },
39
+ plugins: {
40
+ // Add the react plugin
41
+ react,
42
+ },
43
+ rules: {
44
+ // other rules...
45
+ // Enable its recommended rules
46
+ ...react.configs.recommended.rules,
47
+ ...react.configs['jsx-runtime'].rules,
48
+ },
49
+ })
50
+ ```
package/eslint.config.js CHANGED
@@ -1,28 +1,28 @@
1
- import js from '@eslint/js'
2
- import globals from 'globals'
3
- import reactHooks from 'eslint-plugin-react-hooks'
4
- import reactRefresh from 'eslint-plugin-react-refresh'
5
- import tseslint from 'typescript-eslint'
6
-
7
- export default tseslint.config(
8
- { ignores: ['dist'] },
9
- {
10
- extends: [js.configs.recommended, ...tseslint.configs.recommended],
11
- files: ['**/*.{ts,tsx}'],
12
- languageOptions: {
13
- ecmaVersion: 2020,
14
- globals: globals.browser,
15
- },
16
- plugins: {
17
- 'react-hooks': reactHooks,
18
- 'react-refresh': reactRefresh,
19
- },
20
- rules: {
21
- ...reactHooks.configs.recommended.rules,
22
- 'react-refresh/only-export-components': [
23
- 'warn',
24
- { allowConstantExport: true },
25
- ],
26
- },
27
- },
28
- )
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+ import reactHooks from 'eslint-plugin-react-hooks'
4
+ import reactRefresh from 'eslint-plugin-react-refresh'
5
+ import tseslint from 'typescript-eslint'
6
+
7
+ export default tseslint.config(
8
+ { ignores: ['dist'] },
9
+ {
10
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
11
+ files: ['**/*.{ts,tsx}'],
12
+ languageOptions: {
13
+ ecmaVersion: 2020,
14
+ globals: globals.browser,
15
+ },
16
+ plugins: {
17
+ 'react-hooks': reactHooks,
18
+ 'react-refresh': reactRefresh,
19
+ },
20
+ rules: {
21
+ ...reactHooks.configs.recommended.rules,
22
+ 'react-refresh/only-export-components': [
23
+ 'warn',
24
+ { allowConstantExport: true },
25
+ ],
26
+ },
27
+ },
28
+ )
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
- {
2
- "name": "@pubuduth-aplicy/chat-ui",
3
- "version": "2.1.62",
4
- "description": "This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.",
5
- "license": "ISC",
6
- "author": "",
7
- "type": "module",
8
- "main": "src/index.tsx",
9
- "types": "src/declarations.d.ts",
10
- "scripts": {
11
- "build": "tsc ",
12
- "prepare": "npm run build"
13
- },
14
- "dependencies": {
15
- "@tanstack/react-query": "^5.67.2",
16
- "axios": "^1.8.2",
17
- "react": "^19.0.0",
18
- "react-dom": "^19.0.0",
19
- "react-intersection-observer": "^9.16.0",
20
- "socket.io-client": "^4.8.1",
21
- "zustand": "^5.0.3"
22
- },
23
- "devDependencies": {
24
- "@eslint/js": "^9.21.0",
25
- "@types/react": "^19.0.10",
26
- "@types/react-dom": "^19.0.4",
27
- "@vitejs/plugin-react": "^4.3.4",
28
- "autoprefixer": "^10.4.20",
29
- "eslint": "^9.21.0",
30
- "eslint-plugin-react-hooks": "^5.0.0",
31
- "eslint-plugin-react-refresh": "^0.4.19",
32
- "globals": "^15.15.0",
33
- "tailwindcss": "^3.4.14",
34
- "typescript": "^5.7.3",
35
- "typescript-eslint": "^8.24.1",
36
- "vite": "^6.2.0"
37
- }
38
- }
1
+ {
2
+ "name": "@pubuduth-aplicy/chat-ui",
3
+ "version": "2.1.63",
4
+ "description": "This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.",
5
+ "license": "ISC",
6
+ "author": "",
7
+ "type": "module",
8
+ "main": "src/index.tsx",
9
+ "types": "src/declarations.d.ts",
10
+ "scripts": {
11
+ "build": "tsc ",
12
+ "prepare": "npm run build"
13
+ },
14
+ "dependencies": {
15
+ "@tanstack/react-query": "^5.67.2",
16
+ "axios": "^1.8.2",
17
+ "react": "^19.0.0",
18
+ "react-dom": "^19.0.0",
19
+ "react-intersection-observer": "^9.16.0",
20
+ "socket.io-client": "^4.8.1",
21
+ "zustand": "^5.0.3"
22
+ },
23
+ "devDependencies": {
24
+ "@eslint/js": "^9.21.0",
25
+ "@types/react": "^19.0.10",
26
+ "@types/react-dom": "^19.0.4",
27
+ "@vitejs/plugin-react": "^4.3.4",
28
+ "autoprefixer": "^10.4.20",
29
+ "eslint": "^9.21.0",
30
+ "eslint-plugin-react-hooks": "^5.0.0",
31
+ "eslint-plugin-react-refresh": "^0.4.19",
32
+ "globals": "^15.15.0",
33
+ "tailwindcss": "^3.4.14",
34
+ "typescript": "^5.7.3",
35
+ "typescript-eslint": "^8.24.1",
36
+ "vite": "^6.2.0"
37
+ }
38
+ }
@@ -1,8 +1,8 @@
1
- const config = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- };
7
-
8
- export default config;
1
+ const config = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ };
7
+
8
+ export default config;
@@ -1,6 +1,7 @@
1
1
  // config.ts
2
2
  export interface ChatConfig {
3
3
  apiUrl: string;
4
+ role: string;
4
5
  }
5
6
 
6
7
  let chatConfig: ChatConfig;
@@ -3,5 +3,6 @@ export const Path = {
3
3
  getmessage: "api/chat/getMessage",
4
4
  sendmessage:"api/chat",
5
5
  apiProxy:'api/proxy-download',
6
- preSignUrl:"api/chat/generatePresignedUrl"
6
+ preSignUrl:"api/chat/generatePresignedUrl",
7
+ getConversationListByAdmin:"api/chat/getConversationListByAdmin"
7
8
  };
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { getChatConfig } from "../Chat.config";
2
3
  import { getApiClient } from "../lib/api/apiClient";
3
4
  import { Path } from "../lib/api/endpoint";
4
5
  import { ApiResponse } from "../types/type";
@@ -6,8 +7,16 @@ import { ApiResponse } from "../types/type";
6
7
 
7
8
  export const getAllConversationData = async (userid: string) => {
8
9
  try {
10
+ const {role} = getChatConfig();
9
11
  const apiClient = getApiClient();
10
- const res = await apiClient.get<ApiResponse>(`${Path.getconversation}/${userid}`);
12
+ //create common variable and assign the value of role
13
+ // check if the user is an admin
14
+ //create url for admon and user
15
+ const endpoint = role === 'admin'
16
+ ? `${Path.getConversationListByAdmin}/admin`
17
+ : `${Path.getconversation}/${userid}`;
18
+ //create url for admon and user
19
+ const res = await apiClient.get<ApiResponse>(endpoint);
11
20
  if (res.data) {
12
21
  console.log("API Response: ", res.data);
13
22
 
package/tsconfig.app.json CHANGED
@@ -1,29 +1,29 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
- "target": "ES2020",
5
- "useDefineForClassFields": true,
6
- "allowSyntheticDefaultImports": true,
7
- "resolveJsonModule": true,
8
- "esModuleInterop": true,
9
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
10
- "module": "ESNext",
11
- "skipLibCheck": true,
12
-
13
- /* Bundler mode */
14
- "moduleResolution": "bundler",
15
- "allowImportingTsExtensions": true,
16
- "isolatedModules": true,
17
- "moduleDetection": "force",
18
- "noEmit": true,
19
- "jsx": "react-jsx",
20
-
21
- /* Linting */
22
- "strict": true,
23
- "noUnusedLocals": true,
24
- "noUnusedParameters": true,
25
- "noFallthroughCasesInSwitch": true,
26
- "noUncheckedSideEffectImports": true
27
- },
28
- "include": ["src"]
29
- }
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2020",
5
+ "useDefineForClassFields": true,
6
+ "allowSyntheticDefaultImports": true,
7
+ "resolveJsonModule": true,
8
+ "esModuleInterop": true,
9
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
10
+ "module": "ESNext",
11
+ "skipLibCheck": true,
12
+
13
+ /* Bundler mode */
14
+ "moduleResolution": "bundler",
15
+ "allowImportingTsExtensions": true,
16
+ "isolatedModules": true,
17
+ "moduleDetection": "force",
18
+ "noEmit": true,
19
+ "jsx": "react-jsx",
20
+
21
+ /* Linting */
22
+ "strict": true,
23
+ "noUnusedLocals": true,
24
+ "noUnusedParameters": true,
25
+ "noFallthroughCasesInSwitch": true,
26
+ "noUncheckedSideEffectImports": true
27
+ },
28
+ "include": ["src"]
29
+ }
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
- {
2
- "files": [],
3
- "references": [
4
- { "path": "./tsconfig.app.json" }
5
- ]
6
- }
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" }
5
+ ]
6
+ }