Skip to content

Commit 6a32b4d

Browse files
authored
Merge pull request #10 from patbil/tests
added tests
2 parents 8dbaaf3 + 1704392 commit 6a32b4d

13 files changed

Lines changed: 6531 additions & 1529 deletions

CHANGELOG.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,42 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
3+
## [0.0.4] - 2025-10-24
44

5-
### [0.0.4](https://github.com/patbil/angular-strapi-client/compare/v0.0.3...v0.0.4) (2025-10-24)
5+
### Changed
6+
7+
- **StrapiService**: Shared the Strapi URL with services extending StrapiService — marked as protected
68

7-
### 0.0.3 (2025-10-23)
9+
## [0.0.3] - 2025-10-23
810

911
### Infrastructure
12+
1013
- **CI/CD Pipeline**: GitHub Actions workflow for automatic NPM deployment on release
1114

1215
## [0.0.2] - 2025-01-23
1316

1417
### Added
1518

16-
- **AuthService**: Separated authentication logic into dedicated service with `setAuthToken()`, `getAuthToken()`, and `clearAuthToken()` methods
17-
- **HttpBuilderService**: New internal service for building HTTP requests with proper header management
18-
- **Prettier configuration**: Added `.prettierrc` for consistent code formatting
19+
- **AuthService**: Separated authentication logic into dedicated service with `setAuthToken()`, `getAuthToken()`, and `clearAuthToken()` methods
20+
- **HttpBuilderService**: New internal service for building HTTP requests with proper header management
21+
- **Prettier configuration**: Added `.prettierrc` for consistent code formatting
1922

2023
### Changed
2124

22-
- **Project structure**: Reorganized services into dedicated subdirectories
23-
- **README.md**: Improved documentation with detailed examples and API reference
24-
- **package.json**: Updated author information and repository URLs
25+
- **Project structure**: Reorganized services into dedicated subdirectories
26+
- **README.md**: Improved documentation with detailed examples and API reference
27+
- **package.json**: Updated author information and repository URLs
2528

2629
### Breaking Changes
2730

28-
- Authentication methods (`setAuthToken`, `clearAuthToken`) moved from `StrapiService` to `AuthService`
29-
- Migration guide: Inject `AuthService` separately for authentication operations
31+
- Authentication methods (`setAuthToken`, `clearAuthToken`) moved from `StrapiService` to `AuthService`
32+
- Migration guide: Inject `AuthService` separately for authentication operations
3033

31-
## [0.0.1] - 2025-01-XX
34+
## [0.0.1] - 2025-01-22
3235

3336
### Added
3437

35-
- Initial release
36-
- Type-safe Angular HTTP client for Strapi v5+
37-
- Support for filtering, sorting, pagination, population
38-
- Bearer token authentication
39-
- Full TypeScript support with generics
38+
- Initial release
39+
- Type-safe Angular HTTP client for Strapi v5+
40+
- Support for filtering, sorting, pagination, population
41+
- Bearer token authentication
42+
- Full TypeScript support with generics

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ A type-safe Angular HTTP client library for Strapi v5+ with support for filterin
66

77
## Features
88

9-
- Full TypeScript support with generics
10-
- Strapi v5 compatible
11-
- Advanced filtering, sorting, and population
12-
- Built-in pagination and localization support
13-
- Bearer token authentication
9+
- Full TypeScript support with generics
10+
- Strapi v5 compatible
11+
- Advanced filtering, sorting, and population
12+
- Built-in pagination and localization support
13+
- Bearer token authentication
1414

1515
## Installation
1616

@@ -107,8 +107,8 @@ For more details see this page: [Strapi filters](https://docs.strapi.io/cms/api/
107107
You can sort one or more fields.
108108
Sorting order can be defined by operators:
109109

110-
- :asc - for ascending (default, can be omitted)
111-
- :desc - for descending
110+
- :asc - for ascending (default, can be omitted)
111+
- :desc - for descending
112112

113113
```typescript
114114
// Single field
@@ -216,15 +216,15 @@ this.authService.clearAuthToken();
216216

217217
### StrapiService Methods
218218

219-
- `get(id?, params?, options?)` - Fetch entries or single entry
220-
- `save(id, data, options?, method?)` - Create (id=null) or update entry
221-
- `delete(id, options?)` - Delete entry
219+
- `get(id?, params?, options?)` - Fetch entries or single entry
220+
- `save(id, data, options?, method?)` - Create (id=null) or update entry
221+
- `delete(id, options?)` - Delete entry
222222

223223
### AuthService Methods
224224

225-
- `setAuthToken(token: string)` - Set authentication token for all requests
226-
- `getAuthToken()` - Get current authentication token
227-
- `clearAuthToken()` - Remove authentication token
225+
- `setAuthToken(token: string)` - Set authentication token for all requests
226+
- `getAuthToken()` - Get current authentication token
227+
- `clearAuthToken()` - Remove authentication token
228228

229229
### StrapiResponse Interface
230230

@@ -271,5 +271,5 @@ Verify the API path in your service matches your Strapi content type (e.g., `/ap
271271

272272
## Requirements
273273

274-
- Angular 19.2.0+
275-
- Strapi v5+
274+
- Angular 19.2.0+
275+
- Strapi v5+

jest.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
preset: 'jest-preset-angular',
3+
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
4+
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/dist/'],
5+
modulePathIgnorePatterns: ['<rootDir>/dist/'],
6+
transform: {
7+
'^.+\\.ts$': 'ts-jest',
8+
},
9+
transformIgnorePatterns: ['/node_modules/(?!flat)/'],
10+
};

0 commit comments

Comments
 (0)