Skip to content

Commit 87d79fd

Browse files
committed
chore: fix the generated client issue
1 parent a3414a5 commit 87d79fd

File tree

7 files changed

+65
-53
lines changed

7 files changed

+65
-53
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup Node.js
2626
uses: actions/setup-node@v4
2727
with:
28-
node-version: "18"
28+
node-version: "22"
2929
cache: "npm"
3030

3131
- name: Install dependencies
@@ -64,7 +64,7 @@ jobs:
6464
- name: Setup Node.js
6565
uses: actions/setup-node@v4
6666
with:
67-
node-version: "18"
67+
node-version: "22"
6868
cache: "npm"
6969

7070
- name: Install dependencies
@@ -116,7 +116,7 @@ jobs:
116116
- name: Setup Node.js
117117
uses: actions/setup-node@v4
118118
with:
119-
node-version: "18"
119+
node-version: "22"
120120
cache: "npm"
121121

122122
- name: Install dependencies

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
1414
## 🌟 Overview
1515

16-
CocoaFlow is a comprehensive **API specification** designed for managing cocoa industry operations, including farmer management, farm tracking, certification compliance, and supply chain optimization. This specification serves as the contract between frontend and backend teams, ensuring consistent development and integration.
17-
18-
> **Note**: This is an API specification project. The actual API implementation is in development. You can use this specification to understand the API design and generate client libraries.
16+
CocoaFlow is a comprehensive **API specification** designed for managing cocoa industry operations, from farm to end consumer, including farmer management, farm tracking, certification compliance, and supply chain optimization. This specification serves as the contract between frontend and backend teams, ensuring consistent development and integration.
1917

2018
### 🎯 Key Features
2119

2220
- **Farmer Management**: Complete farmer profiles, contracts, and relationship tracking
2321
- **Farm Operations**: GPS coordinates, inspection data, and compliance monitoring
22+
- **Inspections (internal and external)**: follow up of farmer to comply with Rainforest Alliance standards and regulations for agriculture.
2423
- **Certification Support**: Rainforest Alliance compliance tracking and audit trails
25-
- **Supply Chain**: Market management, transactions, and inventory tracking
26-
- **Training & Education**: Session management and participant tracking
24+
- **Supply Chain**: Market management, transactions, and inventory tracking, and tansport and storage to factory plant.
25+
- **Training & Education**: Session management and participant tracking for farmers by the industry.
2726
- **Analytics & Reporting**: Comprehensive data insights and business intelligence
2827

2928
### 🏗️ Architecture Highlights
@@ -66,9 +65,17 @@ npm run docs:build # Build static documentation
6665
npm run lint # Lint OpenAPI specification
6766
npm run validate # Validate specification
6867

68+
or
69+
npm run test # Run tests
70+
71+
6972
# Build & Generate
7073
npm run bundle # Bundle specification into single file
7174
npm run generate:client # Generate TypeScript client
75+
76+
# view the specification
77+
npm run build
78+
npm run preview
7279
```
7380

7481
## 📚 Documentation

openapitools.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
3+
"spaces": 2,
4+
"generator-cli": {
5+
"version": "7.14.0"
6+
}
7+
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"url": "https://github.com/frckbrice/project-api_spec/issues"
2929
},
3030
"engines": {
31-
"node": ">=18.0.0",
32-
"npm": ">=8.0.0"
31+
"node": ">=22.0.0",
32+
"npm": ">=10.0.0"
3333
},
3434
"scripts": {
3535
"prepare": "husky install",
@@ -46,7 +46,7 @@
4646
"docs:serve": "redocly preview-docs ./swt_api_spec/cocoaflow-api.yaml --port 8080",
4747
"docs:build": "redocly build-docs ./swt_api_spec/cocoaflow-api.yaml -o ./public/index.html",
4848
"generate:client": "openapi-generator-cli generate -i ./dist/cocoaflow-api.yaml -g typescript-axios -o ./generated/typescript",
49-
"generate:postman": "openapi-generator-cli generate -i ./dist/cocoaflow-api.yaml -g postman -o ./generated/postman",
49+
"generate:postman": "openapi-generator-cli generate -i ./dist/cocoaflow-api.yaml -g postman-collection -o ./generated/postman",
5050
"clean": "rm -rf ./dist ./generated ./docs",
5151
"version": "npm run bundle && git add -A dist",
5252
"postversion": "git push && git push --tags"

swt_api_spec/cocoaflow-api.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ paths:
219219
"/auth/logout":
220220
$ref: paths/auth/logout.yaml
221221
"/auth/me":
222-
get:
223-
$ref: paths/auth/auth.yaml#/get
222+
$ref: paths/auth/me.yaml
224223
"/users": # user
225224
$ref: paths/user/user.yaml
226225
"/users/{id}":

swt_api_spec/paths/auth/auth.yaml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,3 @@
1-
get:
2-
tags:
3-
- 🔐 Authentication
4-
summary: Get current user
5-
description: Get the currently authenticated user's information
6-
operationId: getCurrentUser
7-
security:
8-
- BearerAuth: []
9-
responses:
10-
"200":
11-
description: User profile retrieved successfully
12-
content:
13-
application/json:
14-
schema:
15-
type: object
16-
properties:
17-
success:
18-
type: boolean
19-
example: true
20-
data:
21-
$ref: "../../components/schemas/user.yaml"
22-
example:
23-
success: true
24-
data:
25-
id: "clh1234567890abcdef"
26-
email: "user@example.com"
27-
first_name: "John"
28-
last_name: "Doe"
29-
role: "user"
30-
company_id: "clh1234567890abcdef"
31-
phone_number: "+2341234567890"
32-
is_active: true
33-
last_login: "2024-01-15T10:30:00Z"
34-
created_at: "2024-01-15T10:30:00Z"
35-
updated_at: "2024-01-15T10:30:00Z"
36-
"401":
37-
$ref: "../../components/responses/UnauthorizedError.yaml"
38-
"500":
39-
$ref: "../../components/responses/ServerError.yaml"
40-
411
post:
422
tags:
433
- 🔐 Authentication

swt_api_spec/paths/auth/me.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
get:
2+
tags:
3+
- 🔐 Authentication
4+
summary: Get current user
5+
description: Get the currently authenticated user's information
6+
operationId: getCurrentUser
7+
security:
8+
- BearerAuth: []
9+
responses:
10+
"200":
11+
description: User profile retrieved successfully
12+
content:
13+
application/json:
14+
schema:
15+
type: object
16+
properties:
17+
success:
18+
type: boolean
19+
example: true
20+
data:
21+
$ref: "../../components/schemas/user.yaml"
22+
example:
23+
success: true
24+
data:
25+
id: "clh1234567890abcdef"
26+
email: "user@example.com"
27+
first_name: "John"
28+
last_name: "Doe"
29+
role: "user"
30+
company_id: "clh1234567890abcdef"
31+
phone_number: "+2341234567890"
32+
is_active: true
33+
last_login: "2024-01-15T10:30:00Z"
34+
created_at: "2024-01-15T10:30:00Z"
35+
updated_at: "2024-01-15T10:30:00Z"
36+
"401":
37+
$ref: "../../components/responses/UnauthorizedError.yaml"
38+
"500":
39+
$ref: "../../components/responses/ServerError.yaml"

0 commit comments

Comments
 (0)