docs: implement Phase 2 - API documentation with TypeDoc
Set up TypeDoc to auto-generate comprehensive API reference documentation from TypeScript source code. Changes: - Installed typedoc and typedoc-plugin-markdown (v0.2.0 plugins) - Created typedoc.json configuration with 9 entry points - Added docs:api and docs:watch npm scripts - Fixed test file imports (validateNamespace → isValidNamespace) - Updated tsconfig.json to exclude test files from compilation - Generated markdown API documentation in docs/api-reference/generated/ Generated API documentation: - 9 modules documented (lib/, hooks/, types/) - lib/crypto - 14 encryption/certificate functions - lib/controller - 5 Kubernetes API functions - lib/validators - 6 validation functions - lib/retry - Exponential backoff utilities - lib/rbac - RBAC permission checking - types - Result types, branded types, interfaces - hooks/useSealedSecretEncryption - Encryption React hook - hooks/usePermissions - RBAC React hooks - hooks/useControllerHealth - Health monitoring hook Benefits: - Auto-generated from TypeScript source (stays in sync) - Markdown format for easy integration - Type signatures and JSDoc included - Function parameters and return types documented - Links between related types and functions Phase 2 deliverables (2-3 days estimated, completed in 1 session): ✅ TypeDoc installed and configured ✅ Entry points identified for all core modules ✅ API documentation generated (9 modules, 40+ functions) ✅ npm scripts added for docs generation ✅ Test files excluded from documentation Next: Phase 3 - User tutorials and guides Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
[**Headlamp Sealed Secrets API v0.2.0**](../../README.md)
|
||||
|
||||
***
|
||||
|
||||
[Headlamp Sealed Secrets API](../../README.md) / lib/retry
|
||||
|
||||
# lib/retry
|
||||
|
||||
## Interfaces
|
||||
|
||||
- [RetryOptions](interfaces/RetryOptions.md)
|
||||
|
||||
## Functions
|
||||
|
||||
- [retryWithBackoff](functions/retryWithBackoff.md)
|
||||
- [isNetworkError](functions/isNetworkError.md)
|
||||
- [isRetryableHttpError](functions/isRetryableHttpError.md)
|
||||
- [isRetryableError](functions/isRetryableError.md)
|
||||
@@ -0,0 +1,27 @@
|
||||
[**Headlamp Sealed Secrets API v0.2.0**](../../../README.md)
|
||||
|
||||
***
|
||||
|
||||
[Headlamp Sealed Secrets API](../../../README.md) / [lib/retry](../README.md) / isNetworkError
|
||||
|
||||
# Function: isNetworkError()
|
||||
|
||||
> **isNetworkError**(`error`): `boolean`
|
||||
|
||||
Defined in: [src/lib/retry.ts:147](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L147)
|
||||
|
||||
Predicate to check if error is a network error (retryable)
|
||||
|
||||
## Parameters
|
||||
|
||||
### error
|
||||
|
||||
`Error`
|
||||
|
||||
Error to check
|
||||
|
||||
## Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
true if error is network-related
|
||||
@@ -0,0 +1,27 @@
|
||||
[**Headlamp Sealed Secrets API v0.2.0**](../../../README.md)
|
||||
|
||||
***
|
||||
|
||||
[Headlamp Sealed Secrets API](../../../README.md) / [lib/retry](../README.md) / isRetryableError
|
||||
|
||||
# Function: isRetryableError()
|
||||
|
||||
> **isRetryableError**(`error`): `boolean`
|
||||
|
||||
Defined in: [src/lib/retry.ts:186](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L186)
|
||||
|
||||
Combined predicate for network and HTTP errors
|
||||
|
||||
## Parameters
|
||||
|
||||
### error
|
||||
|
||||
`Error`
|
||||
|
||||
Error to check
|
||||
|
||||
## Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
true if error is retryable
|
||||
@@ -0,0 +1,27 @@
|
||||
[**Headlamp Sealed Secrets API v0.2.0**](../../../README.md)
|
||||
|
||||
***
|
||||
|
||||
[Headlamp Sealed Secrets API](../../../README.md) / [lib/retry](../README.md) / isRetryableHttpError
|
||||
|
||||
# Function: isRetryableHttpError()
|
||||
|
||||
> **isRetryableHttpError**(`error`): `boolean`
|
||||
|
||||
Defined in: [src/lib/retry.ts:165](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L165)
|
||||
|
||||
Predicate to check if HTTP error is retryable (5xx, 429, 408)
|
||||
|
||||
## Parameters
|
||||
|
||||
### error
|
||||
|
||||
`Error`
|
||||
|
||||
Error to check
|
||||
|
||||
## Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
true if HTTP status is retryable
|
||||
@@ -0,0 +1,52 @@
|
||||
[**Headlamp Sealed Secrets API v0.2.0**](../../../README.md)
|
||||
|
||||
***
|
||||
|
||||
[Headlamp Sealed Secrets API](../../../README.md) / [lib/retry](../README.md) / retryWithBackoff
|
||||
|
||||
# Function: retryWithBackoff()
|
||||
|
||||
> **retryWithBackoff**\<`T`, `E`\>(`operation`, `options?`): [`AsyncResult`](../../../types/type-aliases/AsyncResult.md)\<`T`, `string`\>
|
||||
|
||||
Defined in: [src/lib/retry.ts:86](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L86)
|
||||
|
||||
Retry an async operation with exponential backoff
|
||||
|
||||
## Type Parameters
|
||||
|
||||
### T
|
||||
|
||||
`T`
|
||||
|
||||
### E
|
||||
|
||||
`E`
|
||||
|
||||
## Parameters
|
||||
|
||||
### operation
|
||||
|
||||
() => [`AsyncResult`](../../../types/type-aliases/AsyncResult.md)\<`T`, `E`\>
|
||||
|
||||
Async operation to retry (should return AsyncResult)
|
||||
|
||||
### options?
|
||||
|
||||
[`RetryOptions`](../interfaces/RetryOptions.md) = `{}`
|
||||
|
||||
Retry configuration
|
||||
|
||||
## Returns
|
||||
|
||||
[`AsyncResult`](../../../types/type-aliases/AsyncResult.md)\<`T`, `string`\>
|
||||
|
||||
Result of the operation or final error after all retries
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
const result = await retryWithBackoff(
|
||||
async () => fetchPublicCertificate(config),
|
||||
{ maxAttempts: 3, initialDelayMs: 1000 }
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,81 @@
|
||||
[**Headlamp Sealed Secrets API v0.2.0**](../../../README.md)
|
||||
|
||||
***
|
||||
|
||||
[Headlamp Sealed Secrets API](../../../README.md) / [lib/retry](../README.md) / RetryOptions
|
||||
|
||||
# Interface: RetryOptions
|
||||
|
||||
Defined in: [src/lib/retry.ts:13](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L13)
|
||||
|
||||
Retry configuration options
|
||||
|
||||
## Properties
|
||||
|
||||
### maxAttempts?
|
||||
|
||||
> `optional` **maxAttempts**: `number`
|
||||
|
||||
Defined in: [src/lib/retry.ts:15](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L15)
|
||||
|
||||
Maximum number of retry attempts (default: 3)
|
||||
|
||||
***
|
||||
|
||||
### initialDelayMs?
|
||||
|
||||
> `optional` **initialDelayMs**: `number`
|
||||
|
||||
Defined in: [src/lib/retry.ts:17](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L17)
|
||||
|
||||
Initial delay in milliseconds (default: 1000)
|
||||
|
||||
***
|
||||
|
||||
### maxDelayMs?
|
||||
|
||||
> `optional` **maxDelayMs**: `number`
|
||||
|
||||
Defined in: [src/lib/retry.ts:19](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L19)
|
||||
|
||||
Maximum delay in milliseconds (default: 10000)
|
||||
|
||||
***
|
||||
|
||||
### backoffMultiplier?
|
||||
|
||||
> `optional` **backoffMultiplier**: `number`
|
||||
|
||||
Defined in: [src/lib/retry.ts:21](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L21)
|
||||
|
||||
Backoff multiplier (default: 2 for exponential)
|
||||
|
||||
***
|
||||
|
||||
### useJitter?
|
||||
|
||||
> `optional` **useJitter**: `boolean`
|
||||
|
||||
Defined in: [src/lib/retry.ts:23](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L23)
|
||||
|
||||
Whether to add jitter to delays (default: true)
|
||||
|
||||
***
|
||||
|
||||
### isRetryable()?
|
||||
|
||||
> `optional` **isRetryable**: (`error`) => `boolean`
|
||||
|
||||
Defined in: [src/lib/retry.ts:25](https://github.com/cpfarhood/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/lib/retry.ts#L25)
|
||||
|
||||
Predicate to determine if error is retryable (default: all errors retryable)
|
||||
|
||||
#### Parameters
|
||||
|
||||
##### error
|
||||
|
||||
`Error`
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
Reference in New Issue
Block a user