@progalaxyelabs/ngx-stonescriptphp-client 1.0.0 → 1.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 (32) hide show
  1. package/HLD.md +31 -0
  2. package/LICENSE +21 -0
  3. package/README.md +89 -2
  4. package/dist/ngx-stonescriptphp-client/README.md +186 -0
  5. package/{fesm2022 → dist/ngx-stonescriptphp-client/fesm2022}/progalaxyelabs-ngx-stonescriptphp-client.mjs +28 -28
  6. package/{fesm2022 → dist/ngx-stonescriptphp-client/fesm2022}/progalaxyelabs-ngx-stonescriptphp-client.mjs.map +1 -1
  7. package/dist/ngx-stonescriptphp-client/index.d.ts +184 -0
  8. package/docs/AUTH_COMPATIBILITY.md +310 -0
  9. package/docs/CHANGELOG.md +261 -0
  10. package/package.json +75 -18
  11. package/esm2022/lib/api-connection.service.mjs +0 -304
  12. package/esm2022/lib/api-response.model.mjs +0 -44
  13. package/esm2022/lib/auth.service.mjs +0 -14
  14. package/esm2022/lib/csrf.service.mjs +0 -46
  15. package/esm2022/lib/db.service.mjs +0 -14
  16. package/esm2022/lib/my-environment.model.mjs +0 -31
  17. package/esm2022/lib/ngx-stonescriptphp-client/ngx-stonescriptphp-client.module.mjs +0 -27
  18. package/esm2022/lib/signin-status.service.mjs +0 -23
  19. package/esm2022/lib/token.service.mjs +0 -63
  20. package/esm2022/progalaxyelabs-ngx-stonescriptphp-client.mjs +0 -5
  21. package/esm2022/public-api.mjs +0 -13
  22. package/index.d.ts +0 -5
  23. package/lib/api-connection.service.d.ts +0 -37
  24. package/lib/api-response.model.d.ts +0 -15
  25. package/lib/auth.service.d.ts +0 -6
  26. package/lib/csrf.service.d.ts +0 -24
  27. package/lib/db.service.d.ts +0 -6
  28. package/lib/my-environment.model.d.ts +0 -60
  29. package/lib/ngx-stonescriptphp-client/ngx-stonescriptphp-client.module.d.ts +0 -10
  30. package/lib/signin-status.service.d.ts +0 -10
  31. package/lib/token.service.d.ts +0 -16
  32. package/public-api.d.ts +0 -9
@@ -0,0 +1,310 @@
1
+ # Authentication Compatibility Guide
2
+
3
+ ## StoneScriptPHP Framework vs ngx-stonescriptphp-client
4
+
5
+ This document outlines the authentication flow compatibility between the Angular client library and StoneScriptPHP backend framework (v2.1.x).
6
+
7
+ ---
8
+
9
+ ## ⚠️ CRITICAL INCOMPATIBILITY FOUND
10
+
11
+ ### Token Refresh Endpoint Mismatch
12
+
13
+ **CLIENT IMPLEMENTATION** (`api-connection.service.ts:187`):
14
+ ```typescript
15
+ const refreshTokenUrl = this.host + 'user/refresh_access'
16
+ await fetch(refreshTokenUrl, {
17
+ method: 'POST',
18
+ body: JSON.stringify({
19
+ access_token: this.accessToken,
20
+ refresh_token: refreshToken
21
+ })
22
+ })
23
+ ```
24
+
25
+ **SERVER IMPLEMENTATION** (StoneScriptPHP `RefreshRoute.php`):
26
+ ```php
27
+ // Default route: POST /auth/refresh
28
+ // OR custom: AuthRoutes::register($router, ['prefix' => '/api/auth']);
29
+
30
+ // Expected request:
31
+ // - Refresh token comes from httpOnly cookie (NOT request body)
32
+ // - CSRF token required in X-CSRF-Token header
33
+ // - Does NOT accept tokens in request body for security
34
+
35
+ // Response:
36
+ {
37
+ "status": "ok",
38
+ "data": {
39
+ "access_token": "eyJ...",
40
+ "expires_in": 900,
41
+ "token_type": "Bearer"
42
+ }
43
+ }
44
+ ```
45
+
46
+ ### Issues Identified
47
+
48
+ #### 1. **Endpoint Path Mismatch**
49
+ - **Client expects**: `/user/refresh_access`
50
+ - **Server provides**: `/auth/refresh` (default) or custom prefix
51
+
52
+ #### 2. **Token Transmission Mismatch**
53
+ - **Client sends**: Tokens in JSON request body
54
+ - **Server expects**:
55
+ - Refresh token in httpOnly cookie (named `refresh_token`)
56
+ - CSRF token in `X-CSRF-Token` header
57
+ - **Does NOT read tokens from request body**
58
+
59
+ #### 3. **Security Model Mismatch**
60
+ - **Client**: Stores tokens in localStorage/sessionStorage (via TokenService)
61
+ - **Server**: Uses httpOnly cookies + CSRF protection (XSS-safe)
62
+
63
+ #### 4. **Response Format Mismatch**
64
+ - **Client expects**: `response.data.access_token`
65
+ - **Server returns**: `ApiResponse` where data is the second parameter:
66
+ ```php
67
+ return new ApiResponse('ok', [
68
+ 'access_token' => $token,
69
+ 'expires_in' => 900,
70
+ 'token_type' => 'Bearer'
71
+ ]);
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Authentication Flow Analysis
77
+
78
+ ### StoneScriptPHP Framework Auth System
79
+
80
+ The framework provides **two authentication modes**:
81
+
82
+ #### Mode 1: Built-in Cookie-Based Auth (Secure, Recommended)
83
+ Located in `/src/Auth/Routes/`:
84
+ - `POST /auth/refresh` - Refresh access token using httpOnly cookies
85
+ - `POST /auth/logout` - Logout and invalidate refresh token
86
+
87
+ **Security Features**:
88
+ - httpOnly cookies prevent XSS attacks
89
+ - CSRF token protection
90
+ - Refresh token rotation
91
+ - Optional token blacklisting via `TokenStorageInterface`
92
+
93
+ **Registration**:
94
+ ```php
95
+ // In your index.php or bootstrap
96
+ use StoneScriptPHP\Auth\AuthRoutes;
97
+
98
+ AuthRoutes::register($router, [
99
+ 'prefix' => '/auth', // or '/api/auth'
100
+ 'token_storage' => $tokenStorage // optional
101
+ ]);
102
+ ```
103
+
104
+ #### Mode 2: Custom Implementation (Templates)
105
+ Located in `/src/Templates/Auth/`:
106
+ - `email-password/LoginRoute.php.template`
107
+ - `email-password/RegisterRoute.php.template`
108
+ - `email-password/PasswordResetRoute.php.template`
109
+ - `mobile-otp/SendOtpRoute.php.template`
110
+ - And more...
111
+
112
+ **Note**: Templates are **scaffolding code** that developers customize. They show:
113
+ - Example status values: `'success'` vs `'ok'` (inconsistent!)
114
+ - Example token format
115
+ - Database queries
116
+ - But are NOT the actual built-in implementation
117
+
118
+ ---
119
+
120
+ ## Current Client Implementation Analysis
121
+
122
+ ### What Works ✅
123
+
124
+ 1. **HTTP Methods**: All match (GET, POST, PUT, PATCH, DELETE)
125
+ 2. **ApiResponse Structure**: Compatible
126
+ - Client expects: `{ status: string, message: string, data: any }`
127
+ - Server returns: Same structure
128
+ 3. **Bearer Token Authentication**: Client correctly adds `Authorization: Bearer {token}`
129
+ 4. **Automatic 401 Retry**: Client attempts token refresh on 401 errors
130
+
131
+ ### What's Broken ❌
132
+
133
+ 1. **Token Refresh Flow**: Completely incompatible
134
+ - Different endpoint paths
135
+ - Different token transmission method
136
+ - Different security model
137
+
138
+ 2. **AuthService**: Empty placeholder (no implementation)
139
+
140
+ 3. **Login/Register Endpoints**: Not standardized
141
+ - Templates show `/api/auth/login` but customizable
142
+ - Response format varies (some templates use `'success'` vs `'ok'`)
143
+
144
+ ---
145
+
146
+ ## Compatibility Matrix
147
+
148
+ | Feature | Client (v0.0.13) | Framework (v2.1.x) | Compatible? |
149
+ |---------|------------------|-------------------|-------------|
150
+ | **HTTP Methods** | GET, POST, PUT, PATCH, DELETE | All supported | ✅ Yes |
151
+ | **ApiResponse Format** | `{status, message, data}` | Same | ✅ Yes |
152
+ | **Bearer Auth** | `Authorization: Bearer {token}` | Same | ✅ Yes |
153
+ | **Token Refresh Endpoint** | `/user/refresh_access` | `/auth/refresh` | ❌ No |
154
+ | **Token Storage** | localStorage | httpOnly cookies | ❌ No |
155
+ | **CSRF Protection** | Not implemented | Required | ❌ No |
156
+ | **Login Endpoint** | Not defined | Custom (templates) | ⚠️ Varies |
157
+ | **Token Format** | JWT in response body | JWT in cookie + body | ⚠️ Partial |
158
+
159
+ ---
160
+
161
+ ## Recommended Solutions
162
+
163
+ ### Option 1: Update Client to Match Framework (Recommended)
164
+
165
+ **Pros**:
166
+ - Better security (httpOnly cookies)
167
+ - CSRF protection
168
+ - Aligns with framework best practices
169
+
170
+ **Cons**:
171
+ - Breaking change for existing users
172
+ - Requires cookie handling
173
+
174
+ **Implementation**:
175
+ 1. Update `refreshAccessToken()` to:
176
+ - Call `POST /auth/refresh` with credentials: 'include'
177
+ - Send CSRF token from cookie
178
+ - Don't send tokens in body
179
+ 2. Add `CsrfService` to manage CSRF tokens
180
+ 3. Update `TokenService` to work with cookies
181
+ 4. Add cookie configuration to `MyEnvironmentModel`
182
+
183
+ ### Option 2: Add Server-Side Compatibility Endpoint
184
+
185
+ **Pros**:
186
+ - No client breaking changes
187
+ - Backward compatible
188
+
189
+ **Cons**:
190
+ - Less secure (tokens in body)
191
+ - Developers must implement it
192
+
193
+ **Implementation**:
194
+ Create custom route in StoneScriptPHP project:
195
+ ```php
196
+ // src/App/Routes/LegacyRefreshRoute.php
197
+ class LegacyRefreshRoute implements IRouteHandler {
198
+ public function process(): ApiResponse {
199
+ // Read tokens from request body
200
+ $accessToken = request()->input['access_token'] ?? null;
201
+ $refreshToken = request()->input['refresh_token'] ?? null;
202
+
203
+ // Verify and refresh...
204
+ // Return new access token
205
+ }
206
+ }
207
+
208
+ // Register in routes.php
209
+ 'POST' => [
210
+ '/user/refresh_access' => LegacyRefreshRoute::class
211
+ ]
212
+ ```
213
+
214
+ ### Option 3: Make Client Configurable
215
+
216
+ **Pros**:
217
+ - Supports both modes
218
+ - Migration path
219
+
220
+ **Cons**:
221
+ - More complex
222
+ - Maintenance burden
223
+
224
+ **Implementation**:
225
+ ```typescript
226
+ export interface AuthConfig {
227
+ mode: 'cookie' | 'body';
228
+ refreshEndpoint: string;
229
+ useCsrf: boolean;
230
+ }
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Migration Path for Existing Apps
236
+
237
+ For apps currently using the client with custom backends:
238
+
239
+ ### Step 1: Check Your Backend Auth Implementation
240
+ ```bash
241
+ # Does your backend match the client's expectations?
242
+ curl -X POST http://localhost:8000/user/refresh_access \
243
+ -H "Content-Type: application/json" \
244
+ -d '{"access_token": "...", "refresh_token": "..."}'
245
+ ```
246
+
247
+ ### Step 2: Update to StoneScriptPHP v2.1.x Auth
248
+ ```php
249
+ // Option A: Use built-in secure auth
250
+ AuthRoutes::register($router, ['prefix' => '/api/auth']);
251
+
252
+ // Option B: Create legacy compatibility route
253
+ // See Option 2 above
254
+ ```
255
+
256
+ ### Step 3: Update Client Configuration
257
+ ```typescript
258
+ // Wait for v0.0.14+ with auth config support
259
+ // OR implement custom auth service extending ApiConnectionService
260
+ ```
261
+
262
+ ---
263
+
264
+ ## Action Items for Next Release (v0.0.14)
265
+
266
+ ### Must Fix (Breaking Changes Acceptable):
267
+ 1. ✅ Add configurable auth endpoints
268
+ 2. ✅ Implement cookie-based auth mode
269
+ 3. ✅ Add CSRF token support
270
+ 4. ✅ Update AuthService with actual implementation
271
+ 5. ✅ Document both auth modes
272
+
273
+ ### Should Have:
274
+ 1. Add login/register/logout helper methods
275
+ 2. Add auth state management (RxJS)
276
+ 3. Add auth guards/interceptors examples
277
+ 4. Create migration guide with code examples
278
+
279
+ ### Nice to Have:
280
+ 1. Social auth helpers (Google, etc.)
281
+ 2. Password reset flow helpers
282
+ 3. Email verification helpers
283
+ 4. Multi-factor auth support
284
+
285
+ ---
286
+
287
+ ## Conclusion
288
+
289
+ **Current Status**: ❌ **NOT FULLY COMPATIBLE**
290
+
291
+ The v0.0.13 client library is **compatible for general API calls** (CRUD operations) but **incompatible for authentication flows**.
292
+
293
+ ### For Developers:
294
+ - ✅ Use for: CRUD API calls with manually managed auth
295
+ - ❌ Don't use: Built-in token refresh (broken)
296
+ - ⚠️ Workaround: Implement custom refresh logic or wait for v0.0.14
297
+
298
+ ### For Package Maintainers:
299
+ - 🔴 **Priority**: Fix auth compatibility before promoting package
300
+ - 📝 Add clear warnings in README about auth limitations
301
+ - 🚀 Plan v0.0.14 with breaking changes to align with framework
302
+
303
+ ---
304
+
305
+ ## References
306
+
307
+ - **StoneScriptPHP Auth**: `/src/Auth/Routes/RefreshRoute.php`
308
+ - **Client Auth**: `/projects/ngx-stonescriptphp-client/src/lib/api-connection.service.ts`
309
+ - **Framework Version**: v2.1.x (on Packagist)
310
+ - **Client Version**: v0.0.13
@@ -0,0 +1,261 @@
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
+ ## [1.0.0] - 2025-12-14
9
+
10
+ ### 🎉 Production Ready Release
11
+
12
+ This is the first stable production release of `@progalaxyelabs/ngx-stonescriptphp-client`.
13
+
14
+ #### Repository Organization
15
+ - **Documentation**: Moved CHANGELOG.md and AUTH_COMPATIBILITY.md to `docs/` folder
16
+ - **Project Structure**: Cleaned up root directory - only README.md and HLD.md remain
17
+ - **.gitignore**: Updated for proper npm package exclusions
18
+ - **package.json**: Added `docs` folder to published files
19
+
20
+ #### Why 1.0.0?
21
+ - ✅ Full compatibility with StoneScriptPHP Framework v2.1.x
22
+ - ✅ All major HTTP methods implemented (GET, POST, PUT, PATCH, DELETE)
23
+ - ✅ Configurable authentication modes (cookie/body/none)
24
+ - ✅ CSRF protection support
25
+ - ✅ Comprehensive documentation
26
+ - ✅ Clean repository structure
27
+ - ✅ Production-ready and stable API
28
+
29
+ **No code changes from v0.0.15** - purely organizational improvements and version bump to indicate production readiness.
30
+
31
+ ---
32
+
33
+ ## [0.0.15] - 2025-12-14 (Pre-release)
34
+
35
+ ### 🎉 Major Feature: Configurable Authentication Modes
36
+
37
+ This release adds **full compatibility with StoneScriptPHP Framework v2.1.x authentication** while maintaining backward compatibility.
38
+
39
+ ### Added
40
+
41
+ #### Authentication Configuration
42
+ - **`AuthConfig` interface**: Configure authentication mode, endpoints, and CSRF settings
43
+ - **`AuthMode` type**: Choose between `'cookie'`, `'body'`, or `'none'` authentication modes
44
+ - **Cookie-based auth mode**: Full support for StoneScriptPHP v2.1.x secure httpOnly cookie + CSRF auth (recommended)
45
+ - **Body-based auth mode**: Legacy mode for custom backends (sends tokens in request body)
46
+ - **No-auth mode**: Disable automatic token refresh for manual auth management
47
+
48
+ #### New Services & Methods
49
+ - **`CsrfService`**: Manage CSRF tokens from cookies for secure authentication
50
+ - **`TokenService.setAccessToken()`**: Set only access token
51
+ - **`TokenService.setRefreshToken()`**: Set only refresh token
52
+ - **`MyEnvironmentModel.auth`**: Authentication configuration object
53
+
54
+ ### Changed
55
+
56
+ #### Auth Mode Configuration (Breaking Change with Migration Path)
57
+ - **Default auth mode**: Now defaults to `'cookie'` mode (StoneScriptPHP v2.1.x compatible)
58
+ - **Token refresh**: Completely rewritten to support multiple auth strategies:
59
+ - **Cookie mode**: Uses httpOnly cookies + CSRF tokens, calls `/auth/refresh` (default)
60
+ - **Body mode**: Sends tokens in request body (legacy), calls `/user/refresh_access`
61
+ - **None mode**: Disables automatic token refresh
62
+
63
+ #### Migration Guide for v0.0.10 → v0.0.15
64
+
65
+ **For StoneScriptPHP v2.1.x users (recommended):**
66
+ ```typescript
67
+ // environment.ts
68
+ export const environment = {
69
+ apiServer: { host: 'http://localhost:8000/' },
70
+ auth: {
71
+ mode: 'cookie', // Default, can omit
72
+ refreshEndpoint: '/auth/refresh' // Default, can omit
73
+ }
74
+ }
75
+ ```
76
+
77
+ **For legacy/custom backend users:**
78
+ ```typescript
79
+ // environment.ts
80
+ export const environment = {
81
+ apiServer: { host: 'http://localhost:8000/' },
82
+ auth: {
83
+ mode: 'body',
84
+ refreshEndpoint: '/user/refresh_access'
85
+ }
86
+ }
87
+ ```
88
+
89
+ **To disable auto-refresh:**
90
+ ```typescript
91
+ // environment.ts
92
+ export const environment = {
93
+ apiServer: { host: 'http://localhost:8000/' },
94
+ auth: { mode: 'none' }
95
+ }
96
+ ```
97
+
98
+ ### Fixed
99
+ - ✅ **Authentication compatibility with StoneScriptPHP v2.1.x** - Now fully compatible!
100
+ - ✅ Cookie-based auth with CSRF protection
101
+ - ✅ Configurable refresh endpoints
102
+ - ✅ Proper error handling in both auth modes
103
+
104
+ ### Documentation
105
+ - Updated [AUTH_COMPATIBILITY.md](AUTH_COMPATIBILITY.md) (in docs/) - Auth now fully compatible!
106
+ - Added configuration examples for all auth modes
107
+ - Comprehensive migration guide
108
+
109
+ ---
110
+
111
+ ## [0.0.13] - 2025-12-14 (Skipped - Never Published)
112
+
113
+ ### Added
114
+
115
+ #### ApiConnectionService
116
+ - **DELETE method**: Added `delete<T>(endpoint: string, queryParamsObj?: any): Promise<ApiResponse<T>>` for DELETE HTTP requests
117
+ - **PUT method**: Added `put<T>(pathWithQueryParams: string, data: any): Promise<ApiResponse<T>>` for PUT HTTP requests (full updates)
118
+ - **PATCH method**: Added `patch<T>(pathWithQueryParams: string, data: any): Promise<ApiResponse<T>>` for PATCH HTTP requests (partial updates)
119
+
120
+ #### ApiResponse Model
121
+ - **isSuccess()**: Returns `true` if status is 'ok'
122
+ - **isError()**: Returns `true` if status is 'error' or 'not ok'
123
+ - **getData()**: Returns the data payload or null
124
+ - **getError()**: Returns the error message or 'Unknown error'
125
+ - **getStatus()**: Returns the status string
126
+ - **getMessage()**: Returns the message string
127
+
128
+ ### Fixed
129
+ - Version synchronization between root package.json (0.0.12) and library package.json (was 0.0.10, now 0.0.12)
130
+
131
+ ### Notes
132
+ - `onOk()` and `onNotOk()` methods were already present in ApiResponse (since earlier versions)
133
+ - `DbService` is exported but remains unimplemented - placeholder for future database query functionality
134
+
135
+ ## [0.0.10] - 2025-12-08
136
+
137
+ ### Published to NPM
138
+ - Initial NPM release with GET and POST methods
139
+ - Basic authentication flow with token refresh
140
+ - ApiResponse model with `onOk()`, `onNotOk()`, and `onError()` callbacks
141
+
142
+ ## [0.0.9] - 2025-12-07
143
+
144
+ ### Changed
145
+ - Documentation improvements
146
+ - README updates for npm presentation
147
+
148
+ ## [0.0.8] - 2025-12-06
149
+
150
+ ### Changed
151
+ - Package naming fixes
152
+ - Documentation updates
153
+
154
+ ---
155
+
156
+ ## Migration Guide: v0.0.10 → v0.0.13
157
+
158
+ ### New HTTP Methods Available
159
+
160
+ You can now use all standard REST HTTP methods:
161
+
162
+ ```typescript
163
+ // Before (v0.0.10) - Had to use raw HttpClient for these operations
164
+ constructor(private http: HttpClient) {}
165
+ this.http.delete(`${apiUrl}/users/${id}`).subscribe(...)
166
+
167
+ // After (v0.0.13) - Use ApiConnectionService directly
168
+ constructor(private apiConnection: ApiConnectionService) {}
169
+
170
+ // DELETE
171
+ await this.apiConnection.delete(`/users/${id}`)
172
+ await this.apiConnection.delete(`/users/${id}`, { force: true }) // with query params
173
+
174
+ // PUT (full update)
175
+ await this.apiConnection.put(`/users/${id}`, { name: 'John', email: 'john@example.com' })
176
+
177
+ // PATCH (partial update)
178
+ await this.apiConnection.patch(`/users/${id}`, { name: 'John' })
179
+ ```
180
+
181
+ ### New ApiResponse Helper Methods
182
+
183
+ ```typescript
184
+ // Before (v0.0.10) - Manual status checking
185
+ const response = await this.apiConnection.get('/users')
186
+ if (response.status === 'ok') {
187
+ this.users = response.data
188
+ } else {
189
+ this.error = response.message
190
+ }
191
+
192
+ // After (v0.0.13) - Use helper methods
193
+ const response = await this.apiConnection.get('/users')
194
+
195
+ // Option 1: Helper methods
196
+ if (response.isSuccess()) {
197
+ this.users = response.getData()
198
+ } else {
199
+ this.error = response.getError()
200
+ }
201
+
202
+ // Option 2: Fluent API (still available)
203
+ response
204
+ .onOk(data => this.users = data)
205
+ .onNotOk((message, data) => this.error = message)
206
+ .onError(() => console.error('Network error'))
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Known Issues
212
+
213
+ ### 🔴 CRITICAL: Authentication Flow Incompatibility
214
+
215
+ The token refresh mechanism in v0.0.13 is **incompatible** with StoneScriptPHP Framework v2.1.x built-in authentication.
216
+
217
+ **Issue**: Client expects `/user/refresh_access` endpoint with tokens in request body, but the framework's built-in `RefreshRoute` uses:
218
+ - Endpoint: `/auth/refresh` (default, customizable)
219
+ - Security: httpOnly cookies + CSRF tokens
220
+ - Does NOT accept tokens in request body
221
+
222
+ **Impact**:
223
+ - ✅ **Works**: General API calls (GET, POST, PUT, PATCH, DELETE) with manual token management
224
+ - ❌ **Broken**: Automatic token refresh on 401 errors
225
+ - ⚠️ **Workaround**: Implement custom `/user/refresh_access` route on your backend OR manage auth manually
226
+
227
+ **See**: [AUTH_COMPATIBILITY.md](AUTH_COMPATIBILITY.md) for detailed analysis and solutions.
228
+
229
+ **Fix Planned**: v0.0.14 will add configurable auth modes to support both cookie-based and body-based authentication.
230
+
231
+ ### DbService (Not Yet Implemented)
232
+ The `DbService` is exported in the public API but contains no implementation. It is a placeholder for future database query functionality. Do not use it in production.
233
+
234
+ ### Angular Version Compatibility
235
+ The package is built with Angular 16 but declares peer dependencies for Angular 16-20. While it should work across these versions, comprehensive testing has only been done with Angular 16. If you encounter issues with Angular 19/20, please report them at: https://github.com/progalaxyelabs/ngx-stonescriptphp-client/issues
236
+
237
+ ---
238
+
239
+ ## Roadmap
240
+
241
+ ### Planned for v0.0.13+
242
+ - Complete `DbService` implementation with type-safe database queries
243
+ - HTTP interceptor support for custom auth/logging/retry logic
244
+ - File upload/download support
245
+ - Comprehensive unit tests
246
+ - Rebuild with Angular 19/20 for production
247
+
248
+ ### Future Versions
249
+ - RxJS operators for common patterns
250
+ - WebSocket support for real-time features
251
+ - Migration to `@stonescriptphp` namespace
252
+ - Demo application and Storybook documentation
253
+
254
+ ---
255
+
256
+ ## Links
257
+
258
+ - **NPM Package**: https://www.npmjs.com/package/@progalaxyelabs/ngx-stonescriptphp-client
259
+ - **GitHub Repository**: https://github.com/progalaxyelabs/ngx-stonescriptphp-client
260
+ - **StoneScriptPHP Framework**: https://stonescriptphp.org
261
+ - **Report Issues**: https://github.com/progalaxyelabs/ngx-stonescriptphp-client/issues
package/package.json CHANGED
@@ -1,25 +1,82 @@
1
1
  {
2
2
  "name": "@progalaxyelabs/ngx-stonescriptphp-client",
3
- "version": "1.0.0",
3
+ "version": "1.0.4",
4
+ "description": "Angular client library for StoneScriptPHP backend framework",
5
+ "keywords": [
6
+ "angular",
7
+ "stonescriptphp",
8
+ "http-client",
9
+ "api-client",
10
+ "typescript"
11
+ ],
12
+ "homepage": "https://stonescriptphp.org",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/progalaxyelabs/ngx-stonescriptphp-client.git"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/progalaxyelabs/ngx-stonescriptphp-client/issues"
19
+ },
20
+ "license": "MIT",
21
+ "author": {
22
+ "name": "StoneScriptPHP Team",
23
+ "email": "team@stonescriptphp.org",
24
+ "url": "https://stonescriptphp.org"
25
+ },
26
+ "main": "dist/index.js",
27
+ "types": "dist/index.d.ts",
28
+ "files": [
29
+ "dist",
30
+ "README.md",
31
+ "HLD.md",
32
+ "LICENSE",
33
+ "docs"
34
+ ],
35
+ "scripts": {
36
+ "ng": "ng",
37
+ "start": "ng serve",
38
+ "prebuild": "npm --no-git-tag-version version patch",
39
+ "build": "ng build",
40
+ "watch": "ng build --watch --configuration development",
41
+ "test": "ng test",
42
+ "publish:npm": "npm publish --access public"
43
+ },
44
+ "private": false,
4
45
  "peerDependencies": {
5
- "@angular/common": "^16.2.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
6
- "@angular/core": "^16.2.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0"
46
+ "@angular/common": "^19.0.0 || ^20.0.0",
47
+ "@angular/core": "^19.0.0 || ^20.0.0",
48
+ "rxjs": "^7.8.0"
7
49
  },
8
50
  "dependencies": {
9
- "tslib": "^2.3.0"
51
+ "@angular-devkit/schematics": "^20.0.0",
52
+ "@angular/animations": "^20.0.0",
53
+ "@angular/common": "^20.0.0",
54
+ "@angular/compiler": "^20.0.0",
55
+ "@angular/core": "^20.0.0",
56
+ "@angular/forms": "^20.0.0",
57
+ "@angular/platform-browser": "^20.0.0",
58
+ "@angular/platform-browser-dynamic": "^20.0.0",
59
+ "@angular/router": "^20.0.0",
60
+ "rxjs": "~7.8.0",
61
+ "tslib": "^2.8.0",
62
+ "zone.js": "~0.15.0"
63
+ },
64
+ "devDependencies": {
65
+ "@angular-devkit/build-angular": "^20.0.0",
66
+ "@angular/cli": "^20.0.0",
67
+ "@angular/compiler-cli": "^20.0.0",
68
+ "@schematics/angular": "^20.0.0",
69
+ "@types/jasmine": "~5.1.0",
70
+ "jasmine-core": "~5.5.0",
71
+ "karma": "~6.4.0",
72
+ "karma-chrome-launcher": "~3.2.0",
73
+ "karma-coverage": "~2.2.0",
74
+ "karma-jasmine": "~5.1.0",
75
+ "karma-jasmine-html-reporter": "~2.1.0",
76
+ "ng-packagr": "^20.0.0",
77
+ "typescript": "~5.8.0"
10
78
  },
11
- "sideEffects": false,
12
- "module": "fesm2022/progalaxyelabs-ngx-stonescriptphp-client.mjs",
13
- "typings": "index.d.ts",
14
- "exports": {
15
- "./package.json": {
16
- "default": "./package.json"
17
- },
18
- ".": {
19
- "types": "./index.d.ts",
20
- "esm2022": "./esm2022/progalaxyelabs-ngx-stonescriptphp-client.mjs",
21
- "esm": "./esm2022/progalaxyelabs-ngx-stonescriptphp-client.mjs",
22
- "default": "./fesm2022/progalaxyelabs-ngx-stonescriptphp-client.mjs"
23
- }
79
+ "publishConfig": {
80
+ "access": "public"
24
81
  }
25
- }
82
+ }