Commit 9aaf706
authored
feat((versioning): Implemented versioned route apps (#63)
* feat: Implement API versioning in minimal example with enhanced greet tools
- Updated README to reflect versioning support and added API endpoint details.
- Refactored index.ts to define separate greet tools for v1 (name only) and v2 (name + surname).
- Removed deprecated GreetingWidget component and created version-specific UI components.
- Enhanced styles.css to support version badges and improved UI layout.
- Updated core to support multi-version app configurations and validation.
* docs: Update README and improve code formatting for clarity
- Enhanced README with clearer API endpoint descriptions and input/output specifications.
- Improved formatting in GreetingWidget components for better readability.
- Refactored createApp.ts and server/index.ts for consistent code style and lazy initialization of JWKS client.
- Updated OAuth middleware to support JWKS client as a getter function.
* feat: Add configuration support for protocol in minimal example app
- Introduced a new configuration option for the app to specify the protocol as "openai".
- Updated createApp.ts to manage a shared HTTP server for multi-version applications, enhancing server instance accessibility.
- Improved comments for clarity regarding server instance handling and debug logger configuration.
* docs: Enhance README with API versioning details and examples
- Added a new section on API versioning, explaining how to expose multiple versions from a single app.
- Included code examples demonstrating version-specific tools, configuration overrides, and middleware.
- Updated existing examples to reflect API versioning capabilities.
* docs: Update README and core documentation for improved clarity and formatting
- Added blank lines for better readability in README and core documentation.
- Reformatted tool definitions in the core README for consistency.
- Ensured consistent code style across examples in the documentation.
* refactor: Simplify GreetingWidgetV2 input handling and improve createApp comments
- Removed unnecessary surname check in GreetingWidgetV2 onKeyDown event.
- Updated comments in createApp.ts for clarity on version-specific config merging and server instance handling.
- Cleaned up versioning test file by removing unused server cleanup logic.
* feat: Add health check and OpenAI domain challenge endpoints to createApp
- Implemented a health check endpoint that returns the app status and available versions.
- Added support for handling OpenAI domain verification challenge requests.
- Updated routing logic to return 404 for unmatched routes, ensuring consistency with Express behavior.
- Enhanced comments for clarity on event handling and memory management in the request processing flow.
* feat: Enhance configuration validation and deep merge functionality
- Updated `validateGlobalConfig` to accept `VersionSpecificConfig`, allowing null values to disable properties.
- Introduced `deepMerge` function for recursively merging global and version-specific configurations, with support for null to remove properties.
- Updated `mergeVersionConfig` to utilize deep merging for nested objects, ensuring proper handling of undefined and null values.
- Added tests for deep merging behavior, including scenarios for overriding, disabling, and inheriting configurations.
- Enhanced type definitions for better clarity on configuration structures.
* docs: Remove example curl commands from index.ts for cleaner documentation
- Eliminated example curl commands from the index.ts file to streamline the documentation.
- Focused on providing a clearer overview of available endpoints without cluttering the content.
* refactor: Improve readability and consistency in createApp.ts
- Reformatted conditional checks in validateGlobalConfig for better clarity.
- Updated mergeVersionConfig to enhance readability by using parentheses for nested expressions.
- Ensured consistent handling of null and undefined values in configuration merging logic.
* refactor: Improve deep merge logic in createApp.ts for better property handling
- Updated deepMerge function to build the result object without null properties.
- Replaced direct property deletion with Reflect.deleteProperty to comply with ESLint rules.
- Enhanced comments for clarity on the merging process and runtime validation in versioning tests.1 parent c4d50c8 commit 9aaf706
File tree
14 files changed
+2688
-201
lines changed- examples/minimal
- src
- ui
- packages/core
- src
- server
- oauth
- types
- tests/unit
14 files changed
+2688
-201
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
184 | 249 | | |
185 | 250 | | |
186 | 251 | | |
| |||
455 | 520 | | |
456 | 521 | | |
457 | 522 | | |
458 | | - | |
| 523 | + | |
459 | 524 | | |
460 | 525 | | |
461 | 526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
22 | 25 | | |
23 | 26 | | |
24 | 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 | + | |
25 | 52 | | |
26 | 53 | | |
27 | 54 | | |
28 | 55 | | |
29 | 56 | | |
30 | 57 | | |
31 | 58 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
35 | 64 | | |
36 | 65 | | |
37 | 66 | | |
| |||
42 | 71 | | |
43 | 72 | | |
44 | 73 | | |
45 | | - | |
| 74 | + | |
46 | 75 | | |
47 | | - | |
48 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
49 | 80 | | |
50 | 81 | | |
51 | 82 | | |
52 | 83 | | |
53 | 84 | | |
54 | | - | |
| 85 | + | |
55 | 86 | | |
56 | | - | |
| 87 | + | |
57 | 88 | | |
58 | 89 | | |
59 | 90 | | |
| |||
65 | 96 | | |
66 | 97 | | |
67 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
0 commit comments