Skip to content

Commit b21428c

Browse files
updating swagger description section
1 parent 26ccb3c commit b21428c

1 file changed

Lines changed: 23 additions & 5 deletions

File tree

src/main.ts

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,37 @@ async function bootstrap() {
1616

1717
const config = new DocumentBuilder()
1818
.setTitle('CropWatch RESTful API')
19-
.setDescription('API documentation for CropWatch application')
20-
.setVersion(getCommit())
19+
.setDescription(
20+
`CropWatch API powers authenticated device monitoring, automation, and subscription workflows.
21+
22+
Business scope:
23+
- Monitor field and greenhouse devices with time-series telemetry (air, soil, water, traffic).
24+
- Manage device inventory, online/offline status, and latest sensor values for operations dashboards.
25+
- Configure automation with threshold-based rules and scheduled reports with recipients/alert points.
26+
- Manage subscription billing with Polar checkout, customer portal, subscription state, and product catalog.
27+
28+
Developer notes:
29+
- URI versioning is enabled (current default routes are under /v1).
30+
- Authentication uses Supabase JWT bearer tokens from POST /v1/auth/login.
31+
- Most endpoints are user-scoped and require Authorization: Bearer <token>.
32+
- Telemetry queries support ISO 8601 start/end filters plus optional IANA timezone formatting.
33+
- Device data endpoints support pagination (skip/take) and latest/full payload variants.
34+
- Swagger includes an x-api-key scheme for deployments that enforce API keys upstream.`,
35+
)
36+
.setVersion(`Current Commit: ${getCommit()}`)
2137
.addTag('CropWatch API')
2238
.addBearerAuth(
2339
{ type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
2440
'bearerAuth',
2541
)
2642
.addApiKey({ type: 'apiKey', in: 'header', name: 'x-api-key' }, 'apiKey')
27-
.setLicense('Terms of Use', 'https://CropWatch.io/legal/terms-of-use')
43+
.setLicense('License & Distribution', 'https://www.cropwatch.io/legal/license')
44+
.setTermsOfService('https://www.cropwatch.io/legal/terms-of-service')
45+
.setExternalDoc('GitHub Repository', 'https://github.com/CropWatchDevelopment/api')
2846
.setContact(
2947
'CropWatch Support',
30-
'https://CropWatch.io/support',
31-
'support@cropwatch.io',
48+
'https://github.com/CropWatchDevelopment/api/issues',
49+
'kevin@cropwatch.io',
3250
)
3351
.build();
3452
const documentFactory = () => SwaggerModule.createDocument(app, config);

0 commit comments

Comments
 (0)