@revenium/perplexity 2.0.2 → 2.0.4

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/LICENSE +21 -21
  3. package/README.md +271 -625
  4. package/dist/cjs/constants.js +70 -0
  5. package/dist/cjs/constants.js.map +1 -0
  6. package/dist/cjs/core/tracking/metering.js +86 -6
  7. package/dist/cjs/core/tracking/metering.js.map +1 -1
  8. package/dist/cjs/core/wrapper/perplexity-client.js +11 -1
  9. package/dist/cjs/core/wrapper/perplexity-client.js.map +1 -1
  10. package/dist/cjs/index.js +9 -4
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/cjs/types/index.js +0 -15
  13. package/dist/cjs/types/index.js.map +1 -1
  14. package/dist/esm/constants.js +67 -0
  15. package/dist/esm/constants.js.map +1 -0
  16. package/dist/esm/core/tracking/metering.js +86 -6
  17. package/dist/esm/core/tracking/metering.js.map +1 -1
  18. package/dist/esm/core/wrapper/perplexity-client.js +11 -1
  19. package/dist/esm/core/wrapper/perplexity-client.js.map +1 -1
  20. package/dist/esm/index.js +4 -1
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/types/index.js +1 -14
  23. package/dist/esm/types/index.js.map +1 -1
  24. package/dist/types/constants.d.ts +67 -0
  25. package/dist/types/constants.d.ts.map +1 -0
  26. package/dist/types/core/tracking/metering.d.ts.map +1 -1
  27. package/dist/types/index.d.ts +2 -2
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/dist/types/types/index.d.ts +3 -11
  30. package/dist/types/types/index.d.ts.map +1 -1
  31. package/examples/README.md +322 -0
  32. package/examples/advanced-features.ts +148 -0
  33. package/examples/basic.ts +50 -0
  34. package/examples/chat.ts +73 -0
  35. package/examples/getting_started.ts +64 -0
  36. package/examples/metadata.ts +65 -0
  37. package/examples/streaming.ts +50 -0
  38. package/package.json +72 -69
package/CHANGELOG.md ADDED
@@ -0,0 +1,98 @@
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
+ ## [Unreleased]
9
+
10
+ ## [2.0.4] - 2025-11-07
11
+
12
+ ### Changed
13
+ - Aligned package.json files array with template standards (use dist/ and examples/ wildcards)
14
+ - Updated documentation badge format to match template standards
15
+ - Improved README header with consistent badge styling
16
+
17
+ ### Fixed
18
+ - Removed dist/ build artifacts from version control
19
+ - Added dist/ to .gitignore to prevent future commits of build artifacts
20
+ - Updated API URL to api.revenium.ai in examples/README.md
21
+
22
+ ### Added
23
+
24
+ - New `getting_started.ts` example for quick onboarding
25
+ - New `advanced-features.ts` example with streaming and metadata
26
+ - Comprehensive metadata fields documentation
27
+ - Support for new Perplexity models (sonar-reasoning-pro, sonar-deep-research)
28
+
29
+ ### Changed
30
+
31
+ - Updated model definitions to current Perplexity API
32
+ - Improved example scripts in package.json
33
+
34
+ ### Fixed
35
+
36
+ - Corrected metadata field names throughout documentation
37
+ - Added TypeScript support for subscriptionId and responseQualityScore fields
38
+ - Removed hardcoded credentials from all documentation examples
39
+ - Corrected Revenium platform URLs (app.revenium.ai)
40
+
41
+ ## [2.0.3] - 2025-10-21
42
+
43
+ ### Changed
44
+
45
+ - Enhanced package.json with examples in files array
46
+ - Added community health files (CODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md)
47
+ - Updated .gitignore with security report patterns (including package-lock.json)
48
+ - Added CHANGELOG.md for version tracking
49
+ - Added engines field for Node.js version requirements
50
+
51
+ ## [2.0.2] - 2025-10-17
52
+
53
+ ### Changed
54
+
55
+ - Documentation improvements with absolute path references
56
+
57
+ ## [2.0.1] - 2025-10-09
58
+
59
+ ### Changed
60
+
61
+ - Internal updates and improvements
62
+
63
+ ## [2.0.0] - 2025-10-09
64
+
65
+ ### Added
66
+
67
+ - Complete code restructuring with core/ directory organization
68
+ - Dual package exports (ESM + CommonJS) support
69
+ - TypeScript declaration maps for better debugging
70
+ - Enhanced build system with separate CJS, ESM, and types builds
71
+ - New examples structure (basic.ts, chat.ts, streaming.ts, metadata.ts)
72
+
73
+ ### Changed
74
+
75
+ - Restructured src/ directory with core/config, core/tracking, core/wrapper
76
+ - Updated examples to use new structure
77
+ - Enhanced README with comprehensive documentation
78
+
79
+ ## [1.0.0] - 2025-09-23
80
+
81
+ ### Added
82
+
83
+ - Initial release of Perplexity AI middleware
84
+ - Automatic token counting and usage tracking
85
+ - Support for all Perplexity models
86
+ - Streaming support with automatic tracking
87
+ - Custom metadata integration
88
+ - TypeScript support with full type safety
89
+ - Multiple client options
90
+ - Comprehensive error handling
91
+ - Background processing for non-blocking tracking
92
+ - Debug logging support
93
+
94
+ [2.0.3]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.3
95
+ [2.0.2]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.2
96
+ [2.0.1]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.1
97
+ [2.0.0]: https://github.com/revenium/revenium-middleware-perplexity-node/releases/tag/v2.0.0
98
+ [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.