https://github.com/northwood-labs/devsec-tools-sdk-ts
TypeScript SDK for DevSecTools API.
https://github.com/northwood-labs/devsec-tools-sdk-ts
developer-tools devsec devsecops devsectools javascript sdk typescript
Last synced: 3 months ago
JSON representation
TypeScript SDK for DevSecTools API.
- Host: GitHub
- URL: https://github.com/northwood-labs/devsec-tools-sdk-ts
- Owner: northwood-labs
- License: apache-2.0
- Created: 2025-03-06T00:43:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-06T17:24:26.000Z (over 1 year ago)
- Last Synced: 2025-03-06T18:31:11.214Z (over 1 year ago)
- Topics: developer-tools, devsec, devsecops, devsectools, javascript, sdk, typescript
- Language: Makefile
- Homepage: https://devsec.tools
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# DevSecTools SDK for TypeScript
**Experimental. Untested. Not ready for primetime. Exploring code generation.**
## Overview
A TypeScript/JavaScript SDK for interacting with the [DevSecTools API].
This client provides an easy way to interact with the [DevSecTools API], which scans websites for security-related information such as HTTP version support and TLS configurations.
* ✅ Requires [TypeScript] 5.8+.
* ✅ Uses [fetch()] to handle HTTP requests and supports [async]/[await].
* ✅ Fully-typed; ensures strong IDE support with proper type hints and [TSDoc] docblocks.
## Model
* [openapi.json](https://github.com/northwood-labs/devsec-tools/raw/refs/heads/main/openapi.json)
## Usage
### Instantiating with default configuration
```typescript
import { Client } from "@northwood-labs/devsec-tools-sdk";
const client = new Client();
```
### Custom configuration
```typescript
import { Client, ENDPOINT } from "@northwood-labs/devsec-tools-sdk";
// Using a known endpoint (strictly typed)
const client = new Client({
baseUrl: ENDPOINT.LOCALDEV,
timeoutSeconds: 10,
});
// Using a custom API endpoint (still allowed)
const customClient = new Client({
baseUrl: "https://custom-endpoint.com",
timeoutSeconds: 15,
});
```
### Updating configuration at runtime
```typescript
import { Client, ENDPOINT } from "@northwood-labs/devsec-tools-sdk";
const client = new Client();
client.setBaseUrl(ENDPOINT.LOCALDEV);
client.setTimeoutSeconds(15);
```
### Making single requests
```typescript
import { Client, ENDPOINT } from "@northwood-labs/devsec-tools-sdk";
async function run() {
const client = new Client();
try {
const results = await client.http("example.com");
console.log("Results:", results);
} catch (error) {
console.error("Unexpected Error:", error);
}
}
run();
```
### Making parallel/batch requests
```typescript
import { Client, ENDPOINT } from "@northwood-labs/devsec-tools-sdk";
async function run() {
const client = new Client();
try {
const results = await client.batchRequests([
{ method: "http", url: "apple.com" },
{ method: "tls", url: "google.com" }
]);
console.log("Batch Results:", results);
} catch (error) {
console.error("Unexpected Error:", error);
}
}
run();
```
[async]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
[await]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await
[DevSecTools API]: https://devsec.tools
[fetch()]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
[TSDoc]: https://tsdoc.org
[TypeScript]: https://www.typescriptlang.org