3xui-api-client 2.1.0 โ†’ 2.1.1

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/CHANGELOG.md CHANGED
@@ -1,146 +1,155 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [2.1.0] - 2025-08-30
9
-
10
- ### Added
11
- - ๐Ÿ”ฅ **Firestore Session Store Support** - Custom session handler for Firebase Firestore integration
12
- - ๐Ÿ“ **Enhanced Wiki Documentation** - Comprehensive guides with real-world examples and integration patterns
13
- - ๐Ÿ” **Client Identifier Clarification** - Clear documentation that 'email' field is an identifier, not a real email address
14
-
15
- ### Enhanced
16
- - ๐Ÿ“š **Authentication Guide** - Added detailed session/cookie flow documentation and Firestore integration example
17
- - ๐Ÿ‘ฅ **Client Management Guide** - Clarified email field semantics and added identifier generation examples
18
- - ๐Ÿ› ๏ธ **Inbound Management Guide** - Added protocol-specific authentication method explanations
19
- - ๐Ÿ  **Home Documentation** - Improved navigation and cross-references between guides
20
-
21
- ### Documentation
22
- - **Session Management**: Added comprehensive Firestore adapter example with cleanup patterns
23
- - **API Flow Clarification**: Documented that all API calls automatically include stored session cookies
24
- - **Client Identifiers**: Clarified that 'email' fields use random strings (e.g., '5yhuih4hg93') for privacy
25
- - **Integration Examples**: Enhanced web integration patterns for Express.js and Next.js
26
- - **Security Best Practices**: Consolidated security guidance in Authentication Guide
27
-
28
- ### Removed
29
- - Removed any references to email generation functionality for clarity
30
- - Cleaned up duplicate content across wiki files
31
-
32
- ### Fixed
33
- - Corrected misconceptions about email field usage in 3x-ui
34
- - Improved consistency across documentation
35
-
36
- ## [2.0.0] - 2025-06-25
37
-
38
- ### Added
39
- - ๐ŸŽฏ **Built-in Credential Generation System** - Automatic generation of random passwords, UUIDs, and client identifiers
40
- - ๐Ÿ”ง **Advanced Session Management** - Intelligent session caching, automatic renewal, and multi-server support
41
- - ๐ŸŒ **Web Integration Support** - Express.js and Next.js middleware for seamless web app integration
42
- - ๐Ÿ›ก๏ธ **Enhanced Security Framework** - Input validation, security monitoring, and secure headers management
43
- - ๐Ÿ“ฆ **Modular Architecture** - New `src/` directory structure with specialized modules:
44
- - `CredentialGenerator.js` - Random credential generation utilities
45
- - `SessionManager.js` - Advanced session handling and caching
46
- - `WebMiddleware.js` - Express/Next.js integration helpers
47
- - `ProtocolBuilders.js` - Automated inbound configuration builders
48
- - `SecurityEnhancer.js` - Security validation and monitoring
49
-
50
- ### Enhanced
51
- - ๐Ÿ” **Improved Authentication** - More robust session handling with automatic recovery
52
- - ๐Ÿ“Š **Better Error Handling** - Enhanced error messages and recovery mechanisms
53
- - ๐ŸŽจ **Developer Experience** - Improved TypeScript definitions and code documentation
54
- - ๐Ÿงช **Testing Framework** - Updated test suite with better coverage and reliability
55
- - ๐Ÿ“ **Documentation** - Comprehensive wiki updates with practical examples
56
-
57
- ### New Features
58
- - **Credential Generation**:
59
- - Random password generation with customizable complexity
60
- - UUID v4 generation for unique client identifiers
61
- - Secure random string generation for API keys
62
- - Email-like identifier generation for client management
63
-
64
- - **Session Management**:
65
- - Intelligent session caching with TTL support
66
- - Multi-server session handling
67
- - Automatic session renewal and cleanup
68
- - Database-ready session storage format
69
-
70
- - **Web Integration**:
71
- - Express.js middleware for route protection
72
- - Next.js API route helpers
73
- - Automatic cookie management
74
- - Request/response transformation utilities
75
-
76
- - **Protocol Builders**:
77
- - Automated VLESS configuration generation
78
- - VMess protocol setup helpers
79
- - Trojan and Shadowsocks builders
80
- - Reality and WireGuard configuration support
81
-
82
- ### Changed
83
- - **Breaking Change**: Enhanced API structure with new module organization
84
- - **Package Structure**: Moved from monolithic to modular architecture
85
- - **Dependencies**: Updated to latest stable versions
86
- - **Configuration**: Improved configuration options and defaults
87
-
88
- ### Security
89
- - Enhanced input validation and sanitization
90
- - Improved session security with automatic cleanup
91
- - Better error handling to prevent information leakage
92
- - Security monitoring and alerting capabilities
93
-
94
- ### Developer Experience
95
- - Better TypeScript support with comprehensive type definitions
96
- - Improved documentation with real-world examples
97
- - Enhanced testing framework with automated validation
98
- - ESLint configuration for code quality
99
-
100
- ### Performance
101
- - Optimized session management with intelligent caching
102
- - Reduced API call overhead through better request batching
103
- - Improved memory usage with automatic cleanup
104
- - Faster authentication flow with session reuse
105
-
106
- ## [1.0.0] - 2025-06-20
107
-
108
- ### Added
109
- - Complete API client library for 3x-ui panel management
110
- - Authentication with automatic session management
111
- - Inbound management (5 methods): getInbounds, getInbound, addInbound, updateInbound, deleteInbound
112
- - Client management (7 methods): addClient, updateClient, deleteClient, getClientTrafficsByEmail, getClientTrafficsById, getClientIps, clearClientIps
113
- - Traffic management (4 methods): resetClientTraffic, resetAllTraffics, resetAllClientTraffics, deleteDepletedClients
114
- - System operations (2 methods): getOnlineClients, createBackup
115
- - Comprehensive error handling and automatic re-authentication
116
- - TypeScript definitions for better developer experience
117
- - ESM module support alongside CommonJS
118
- - Complete documentation and wiki guides
119
- - Interactive testing suite with 19 test files
120
- - Security best practices implementation
121
-
122
- ### Features
123
- - ๐Ÿ” Secure session-based authentication
124
- - ๐Ÿ”„ Automatic login retry on session expiry
125
- - ๐Ÿ“Š Complete API coverage (19 routes tested and working)
126
- - ๐Ÿ›ก๏ธ Server-side only design for security
127
- - ๐Ÿ“š Comprehensive documentation with real-world examples
128
- - ๐Ÿงช Extensive testing suite with actual API responses
129
- - ๐Ÿ“ TypeScript support for better DX
130
- - ๐Ÿ”— Both CommonJS and ESM module support
131
-
132
- ### Security
133
- - No vulnerabilities in dependencies
134
- - Secure session cookie handling
135
- - Server-side only architecture
136
- - Input validation and error handling
137
- - Automatic timeout and retry mechanisms
138
-
139
- ## [Unreleased]
140
-
141
- ### Planned
142
- - GitHub Actions CI/CD pipeline
143
- - Automated semantic releases
144
- - Enhanced unit test coverage
145
- - Performance benchmarking tools
146
- - Advanced monitoring and analytics
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [2.1.1] - 2025-11-30
9
+
10
+ ### Fixed
11
+ - ๐Ÿ› **Login Response**: `login()` method now explicitly returns the `cookie` in the response object, making it easier to store sessions in databases.
12
+ - ๐Ÿ”ง **Configuration Auto-fix**: Automatically detects and fixes `PANEL_URL` configuration errors (removing trailing `/panel`) to prevent 404 errors.
13
+
14
+ ### Documentation
15
+ - ๐Ÿ“ **Configuration Guide**: Added critical warning about `PANEL_URL` format in README.
16
+
17
+ ## [2.1.0] - 2025-08-30
18
+
19
+ ### Added
20
+ - ๐Ÿ”ฅ **Firestore Session Store Support** - Custom session handler for Firebase Firestore integration
21
+ - ๐Ÿ“ **Enhanced Wiki Documentation** - Comprehensive guides with real-world examples and integration patterns
22
+ - ๐Ÿ” **Client Identifier Clarification** - Clear documentation that 'email' field is an identifier, not a real email address
23
+
24
+ ### Enhanced
25
+ - ๐Ÿ“š **Authentication Guide** - Added detailed session/cookie flow documentation and Firestore integration example
26
+ - ๐Ÿ‘ฅ **Client Management Guide** - Clarified email field semantics and added identifier generation examples
27
+ - ๐Ÿ› ๏ธ **Inbound Management Guide** - Added protocol-specific authentication method explanations
28
+ - ๐Ÿ  **Home Documentation** - Improved navigation and cross-references between guides
29
+
30
+ ### Documentation
31
+ - **Session Management**: Added comprehensive Firestore adapter example with cleanup patterns
32
+ - **API Flow Clarification**: Documented that all API calls automatically include stored session cookies
33
+ - **Client Identifiers**: Clarified that 'email' fields use random strings (e.g., '5yhuih4hg93') for privacy
34
+ - **Integration Examples**: Enhanced web integration patterns for Express.js and Next.js
35
+ - **Security Best Practices**: Consolidated security guidance in Authentication Guide
36
+
37
+ ### Removed
38
+ - Removed any references to email generation functionality for clarity
39
+ - Cleaned up duplicate content across wiki files
40
+
41
+ ### Fixed
42
+ - Corrected misconceptions about email field usage in 3x-ui
43
+ - Improved consistency across documentation
44
+
45
+ ## [2.0.0] - 2025-06-25
46
+
47
+ ### Added
48
+ - ๐ŸŽฏ **Built-in Credential Generation System** - Automatic generation of random passwords, UUIDs, and client identifiers
49
+ - ๐Ÿ”ง **Advanced Session Management** - Intelligent session caching, automatic renewal, and multi-server support
50
+ - ๐ŸŒ **Web Integration Support** - Express.js and Next.js middleware for seamless web app integration
51
+ - ๐Ÿ›ก๏ธ **Enhanced Security Framework** - Input validation, security monitoring, and secure headers management
52
+ - ๐Ÿ“ฆ **Modular Architecture** - New `src/` directory structure with specialized modules:
53
+ - `CredentialGenerator.js` - Random credential generation utilities
54
+ - `SessionManager.js` - Advanced session handling and caching
55
+ - `WebMiddleware.js` - Express/Next.js integration helpers
56
+ - `ProtocolBuilders.js` - Automated inbound configuration builders
57
+ - `SecurityEnhancer.js` - Security validation and monitoring
58
+
59
+ ### Enhanced
60
+ - ๐Ÿ” **Improved Authentication** - More robust session handling with automatic recovery
61
+ - ๐Ÿ“Š **Better Error Handling** - Enhanced error messages and recovery mechanisms
62
+ - ๐ŸŽจ **Developer Experience** - Improved TypeScript definitions and code documentation
63
+ - ๐Ÿงช **Testing Framework** - Updated test suite with better coverage and reliability
64
+ - ๐Ÿ“ **Documentation** - Comprehensive wiki updates with practical examples
65
+
66
+ ### New Features
67
+ - **Credential Generation**:
68
+ - Random password generation with customizable complexity
69
+ - UUID v4 generation for unique client identifiers
70
+ - Secure random string generation for API keys
71
+ - Email-like identifier generation for client management
72
+
73
+ - **Session Management**:
74
+ - Intelligent session caching with TTL support
75
+ - Multi-server session handling
76
+ - Automatic session renewal and cleanup
77
+ - Database-ready session storage format
78
+
79
+ - **Web Integration**:
80
+ - Express.js middleware for route protection
81
+ - Next.js API route helpers
82
+ - Automatic cookie management
83
+ - Request/response transformation utilities
84
+
85
+ - **Protocol Builders**:
86
+ - Automated VLESS configuration generation
87
+ - VMess protocol setup helpers
88
+ - Trojan and Shadowsocks builders
89
+ - Reality and WireGuard configuration support
90
+
91
+ ### Changed
92
+ - **Breaking Change**: Enhanced API structure with new module organization
93
+ - **Package Structure**: Moved from monolithic to modular architecture
94
+ - **Dependencies**: Updated to latest stable versions
95
+ - **Configuration**: Improved configuration options and defaults
96
+
97
+ ### Security
98
+ - Enhanced input validation and sanitization
99
+ - Improved session security with automatic cleanup
100
+ - Better error handling to prevent information leakage
101
+ - Security monitoring and alerting capabilities
102
+
103
+ ### Developer Experience
104
+ - Better TypeScript support with comprehensive type definitions
105
+ - Improved documentation with real-world examples
106
+ - Enhanced testing framework with automated validation
107
+ - ESLint configuration for code quality
108
+
109
+ ### Performance
110
+ - Optimized session management with intelligent caching
111
+ - Reduced API call overhead through better request batching
112
+ - Improved memory usage with automatic cleanup
113
+ - Faster authentication flow with session reuse
114
+
115
+ ## [1.0.0] - 2025-06-20
116
+
117
+ ### Added
118
+ - Complete API client library for 3x-ui panel management
119
+ - Authentication with automatic session management
120
+ - Inbound management (5 methods): getInbounds, getInbound, addInbound, updateInbound, deleteInbound
121
+ - Client management (7 methods): addClient, updateClient, deleteClient, getClientTrafficsByEmail, getClientTrafficsById, getClientIps, clearClientIps
122
+ - Traffic management (4 methods): resetClientTraffic, resetAllTraffics, resetAllClientTraffics, deleteDepletedClients
123
+ - System operations (2 methods): getOnlineClients, createBackup
124
+ - Comprehensive error handling and automatic re-authentication
125
+ - TypeScript definitions for better developer experience
126
+ - ESM module support alongside CommonJS
127
+ - Complete documentation and wiki guides
128
+ - Interactive testing suite with 19 test files
129
+ - Security best practices implementation
130
+
131
+ ### Features
132
+ - ๐Ÿ” Secure session-based authentication
133
+ - ๐Ÿ”„ Automatic login retry on session expiry
134
+ - ๐Ÿ“Š Complete API coverage (19 routes tested and working)
135
+ - ๐Ÿ›ก๏ธ Server-side only design for security
136
+ - ๐Ÿ“š Comprehensive documentation with real-world examples
137
+ - ๐Ÿงช Extensive testing suite with actual API responses
138
+ - ๐Ÿ“ TypeScript support for better DX
139
+ - ๐Ÿ”— Both CommonJS and ESM module support
140
+
141
+ ### Security
142
+ - No vulnerabilities in dependencies
143
+ - Secure session cookie handling
144
+ - Server-side only architecture
145
+ - Input validation and error handling
146
+ - Automatic timeout and retry mechanisms
147
+
148
+ ## [Unreleased]
149
+
150
+ ### Planned
151
+ - GitHub Actions CI/CD pipeline
152
+ - Automated semantic releases
153
+ - Enhanced unit test coverage
154
+ - Performance benchmarking tools
155
+ - Advanced monitoring and analytics
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Helitha Guruge
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Helitha Guruge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.