@revenium/perplexity 2.0.6 → 2.0.8
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/.env.example +10 -0
- package/CHANGELOG.md +82 -113
- package/LICENSE +21 -21
- package/README.md +408 -292
- package/SECURITY.md +34 -34
- package/dist/cjs/core/config/index.js +0 -1
- package/dist/cjs/core/config/index.js.map +1 -1
- package/dist/cjs/core/config/manager.js +0 -1
- package/dist/cjs/core/config/manager.js.map +1 -1
- package/dist/cjs/core/providers/detector.js +0 -2
- package/dist/cjs/core/providers/detector.js.map +1 -1
- package/dist/cjs/core/providers/index.js +0 -1
- package/dist/cjs/core/providers/index.js.map +1 -1
- package/dist/cjs/index.js +1 -34
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/stop-reason-mapper.js +18 -20
- package/dist/cjs/utils/stop-reason-mapper.js.map +1 -1
- package/dist/esm/core/config/index.js +3 -4
- package/dist/esm/core/config/index.js.map +1 -1
- package/dist/esm/core/config/manager.js +0 -1
- package/dist/esm/core/config/manager.js.map +1 -1
- package/dist/esm/core/providers/detector.js +0 -2
- package/dist/esm/core/providers/detector.js.map +1 -1
- package/dist/esm/core/providers/index.js +0 -1
- package/dist/esm/core/providers/index.js.map +1 -1
- package/dist/esm/index.js +1 -34
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/stop-reason-mapper.js +18 -20
- package/dist/esm/utils/stop-reason-mapper.js.map +1 -1
- package/dist/types/core/config/index.d.ts +3 -4
- package/dist/types/core/config/index.d.ts.map +1 -1
- package/dist/types/core/config/manager.d.ts +0 -1
- package/dist/types/core/config/manager.d.ts.map +1 -1
- package/dist/types/core/providers/detector.d.ts +0 -2
- package/dist/types/core/providers/detector.d.ts.map +1 -1
- package/dist/types/core/providers/index.d.ts +0 -1
- package/dist/types/core/providers/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -32
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/stop-reason-mapper.d.ts +1 -3
- package/dist/types/utils/stop-reason-mapper.d.ts.map +1 -1
- package/examples/README.md +274 -226
- package/examples/advanced.ts +123 -123
- package/examples/basic.ts +45 -45
- package/examples/getting_started.ts +41 -41
- package/examples/metadata.ts +68 -68
- package/examples/stream.ts +53 -53
- package/package.json +80 -72
package/.env.example
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Revenium Configuration (Required)
|
|
2
|
+
REVENIUM_METERING_API_KEY=hak_your_revenium_api_key_here
|
|
3
|
+
REVENIUM_METERING_BASE_URL=https://api.revenium.ai
|
|
4
|
+
|
|
5
|
+
# Perplexity Configuration (Required)
|
|
6
|
+
PERPLEXITY_API_KEY=pplx_your_perplexity_api_key_here
|
|
7
|
+
PERPLEXITY_API_BASE_URL=https://api.perplexity.ai
|
|
8
|
+
|
|
9
|
+
# Debug Configuration (Optional)
|
|
10
|
+
REVENIUM_DEBUG=false # Set to true to enable debug logging
|
package/CHANGELOG.md
CHANGED
|
@@ -1,113 +1,82 @@
|
|
|
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
|
-
## [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
### Changed
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- Complete code restructuring with core/ directory organization
|
|
85
|
-
- Dual package exports (ESM + CommonJS) support
|
|
86
|
-
- TypeScript declaration maps for better debugging
|
|
87
|
-
- Enhanced build system with separate CJS, ESM, and types builds
|
|
88
|
-
|
|
89
|
-
### Changed
|
|
90
|
-
|
|
91
|
-
- Restructured src/ directory with core/config, core/tracking, core/wrapper
|
|
92
|
-
- Enhanced README with comprehensive documentation
|
|
93
|
-
|
|
94
|
-
## [1.0.0] - 2025-09-23
|
|
95
|
-
|
|
96
|
-
### Added
|
|
97
|
-
|
|
98
|
-
- Initial release of Perplexity AI middleware
|
|
99
|
-
- Automatic token counting and usage tracking
|
|
100
|
-
- Streaming support with automatic tracking
|
|
101
|
-
- Custom metadata integration
|
|
102
|
-
- TypeScript support with full type safety
|
|
103
|
-
- Comprehensive error handling
|
|
104
|
-
- Background processing for non-blocking tracking
|
|
105
|
-
- Debug logging support
|
|
106
|
-
|
|
107
|
-
[3.0.0]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v3.0.0
|
|
108
|
-
[2.0.4]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.4
|
|
109
|
-
[2.0.3]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.3
|
|
110
|
-
[2.0.2]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.2
|
|
111
|
-
[2.0.1]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.1
|
|
112
|
-
[2.0.0]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.0
|
|
113
|
-
[1.0.0]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v1.0.0
|
|
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.0.8] - 2025-11-14
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Updated documentation with semver range examples
|
|
13
|
+
- Enhanced package structure for better npm distribution
|
|
14
|
+
- Improved installation instructions and clarity
|
|
15
|
+
- Improved metadata table clarity and accuracy with better field descriptions
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Updated dashboard URL references to app.revenium.ai
|
|
20
|
+
- Documentation improvements for better user experience
|
|
21
|
+
|
|
22
|
+
## [2.0.4] - 2025-10-21
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Enhanced package.json with examples in files array
|
|
27
|
+
- Added community health files (CODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md)
|
|
28
|
+
- Updated .gitignore with security report patterns
|
|
29
|
+
- Added engines field for Node.js version requirements
|
|
30
|
+
|
|
31
|
+
## [2.0.3] - 2025-10-17
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Documentation improvements with absolute path references
|
|
36
|
+
|
|
37
|
+
## [2.0.2] - 2025-10-09
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
|
|
41
|
+
- Internal updates and improvements
|
|
42
|
+
|
|
43
|
+
## [2.0.1] - 2025-10-09
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- Bug fixes and stability improvements
|
|
48
|
+
|
|
49
|
+
## [2.0.0] - 2025-10-09
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- Complete code restructuring with core/ directory organization
|
|
54
|
+
- Dual package exports (ESM + CommonJS) support
|
|
55
|
+
- TypeScript declaration maps for better debugging
|
|
56
|
+
- Enhanced build system with separate CJS, ESM, and types builds
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
|
|
60
|
+
- Restructured src/ directory with core/config, core/tracking, core/wrapper
|
|
61
|
+
- Enhanced README with comprehensive documentation
|
|
62
|
+
|
|
63
|
+
## [1.0.0] - 2025-09-23
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
|
|
67
|
+
- Initial release of Perplexity AI middleware
|
|
68
|
+
- Automatic token counting and usage tracking
|
|
69
|
+
- Streaming support with automatic tracking
|
|
70
|
+
- Custom metadata integration
|
|
71
|
+
- TypeScript support with full type safety
|
|
72
|
+
- Comprehensive error handling
|
|
73
|
+
- Background processing for non-blocking tracking
|
|
74
|
+
- Debug logging support
|
|
75
|
+
|
|
76
|
+
[2.0.8]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.8
|
|
77
|
+
[2.0.4]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.4
|
|
78
|
+
[2.0.3]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.3
|
|
79
|
+
[2.0.2]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.2
|
|
80
|
+
[2.0.1]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.1
|
|
81
|
+
[2.0.0]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.0
|
|
82
|
+
[1.0.0]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v1.0.0
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Revenium
|
|
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
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Revenium
|
|
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
|
+
SOFTWARE.
|