@ebowwa/codespaces-types 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +34 -37
  2. package/dist/runtime/ai.d.ts +1336 -0
  3. package/dist/runtime/ai.d.ts.map +1 -0
  4. package/dist/runtime/ai.js +416 -0
  5. package/dist/runtime/api.d.ts +1304 -0
  6. package/dist/runtime/api.d.ts.map +1 -0
  7. package/dist/runtime/api.js +673 -0
  8. package/dist/runtime/database.d.ts +376 -0
  9. package/dist/runtime/database.d.ts.map +1 -0
  10. package/dist/runtime/database.js +91 -0
  11. package/dist/runtime/env.d.ts +121 -0
  12. package/dist/runtime/env.d.ts.map +1 -0
  13. package/dist/runtime/env.js +54 -0
  14. package/dist/runtime/glm.d.ts +17 -0
  15. package/dist/runtime/glm.d.ts.map +1 -0
  16. package/dist/runtime/glm.js +25 -0
  17. package/dist/runtime/index.d.ts +13 -0
  18. package/dist/runtime/index.d.ts.map +1 -0
  19. package/dist/runtime/index.js +12 -0
  20. package/dist/runtime/ssh.d.ts +111 -0
  21. package/dist/runtime/ssh.d.ts.map +1 -0
  22. package/dist/runtime/ssh.js +44 -0
  23. package/dist/{index.d.ts → types/index.d.ts} +1 -0
  24. package/dist/types/index.d.ts.map +1 -0
  25. package/dist/{resources.d.ts → types/resources.d.ts} +1 -0
  26. package/dist/types/resources.d.ts.map +1 -0
  27. package/dist/{schemas → types/schemas}/resources.d.ts +5 -4
  28. package/dist/types/schemas/resources.d.ts.map +1 -0
  29. package/dist/{terminal-websocket.d.ts → types/terminal-websocket.d.ts} +1 -0
  30. package/dist/types/terminal-websocket.d.ts.map +1 -0
  31. package/dist/{time.d.ts → types/time.d.ts} +1 -0
  32. package/dist/types/time.d.ts.map +1 -0
  33. package/dist/{user → types/user}/distributions.d.ts +1 -1
  34. package/dist/types/user/distributions.d.ts.map +1 -0
  35. package/dist/{user → types/user}/distributions.js +1 -1
  36. package/dist/{validation.d.ts → types/validation.d.ts} +1 -0
  37. package/dist/types/validation.d.ts.map +1 -0
  38. package/package.json +48 -53
  39. package/LICENSE +0 -21
  40. /package/dist/{index.js → types/index.js} +0 -0
  41. /package/dist/{resources.js → types/resources.js} +0 -0
  42. /package/dist/{schemas → types/schemas}/resources.js +0 -0
  43. /package/dist/{terminal-websocket.js → types/terminal-websocket.js} +0 -0
  44. /package/dist/{time.js → types/time.js} +0 -0
  45. /package/dist/{validation.js → types/validation.js} +0 -0
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # @ebowwa/codespaces-types
2
2
 
3
- Shared TypeScript type definitions for Codespaces packages.
3
+ Shared types and runtime validation schemas for codespaces projects.
4
+
5
+ ## Structure
6
+
7
+ - **`/runtime`** - Zod schemas for runtime validation
8
+ - **`/types`** - TypeScript type definitions for compile-time checking
4
9
 
5
10
  ## Installation
6
11
 
@@ -10,58 +15,50 @@ npm install @ebowwa/codespaces-types
10
15
 
11
16
  ## Usage
12
17
 
13
- This package contains shared type definitions used across various Codespaces packages:
14
-
15
- ### Main Types
18
+ ### Runtime Validation (Zod Schemas)
16
19
 
17
20
  ```typescript
18
- import {
19
- Environment,
20
- EnvironmentStatus,
21
- HetznerServerType,
22
- HetznerLocation,
23
- // ... and more
24
- } from '@ebowwa/codespaces-types';
25
- ```
26
-
27
- ### Resource Parsing
21
+ import { CreateEnvironmentRequestSchema } from '@ebowwa/codespaces-types/runtime/api';
28
22
 
29
- ```typescript
30
- import { parseResources, parseCPU, parseMemory } from '@ebowwa/codespaces-types/resources';
23
+ // Validate data at runtime
24
+ const result = CreateEnvironmentRequestSchema.parse(userData);
31
25
  ```
32
26
 
33
- ### Terminal WebSocket Types
27
+ ### Compile-Time Types
34
28
 
35
29
  ```typescript
36
- import {
37
- ClientToServerMessage,
38
- ServerToClientMessage,
39
- WebSocketCloseCode
40
- } from '@ebowwa/codespaces-types/terminal-websocket';
41
- ```
30
+ import type { Environment, HetznerServerType } from '@ebowwa/codespaces-types/types';
42
31
 
43
- ### Time Formatting
44
-
45
- ```typescript
46
- import { formatElapsedTime } from '@ebowwa/codespaces-types/time';
32
+ // Type checking at compile time
33
+ const env: Environment = { /* ... */ };
47
34
  ```
48
35
 
49
- ### Validation
36
+ ### Type Inference (Recommended)
37
+
38
+ Runtime schemas automatically export inferred TypeScript types:
50
39
 
51
40
  ```typescript
52
41
  import {
53
- EnvironmentNameSchema,
54
- validateEnvironmentName
55
- } from '@ebowwa/codespaces-types/validation';
42
+ CreateEnvironmentRequestSchema,
43
+ type CreateEnvironmentRequest
44
+ } from '@ebowwa/codespaces-types/runtime/api';
45
+
46
+ const data: CreateEnvironmentRequest = { /* ... */ };
47
+ const validated = CreateEnvironmentRequestSchema.parse(data);
56
48
  ```
57
49
 
58
- ## Features
50
+ ## Available Exports
51
+
52
+ ### Runtime (`./runtime/*`)
53
+ - `api` - API request/response validation schemas
54
+ - `ai` - AI-related schemas
55
+ - `database` - Database validation schemas
56
+ - `env` - Environment variable schemas
57
+ - `glm` - GLM-specific schemas
58
+ - `ssh` - SSH configuration schemas
59
59
 
60
- - **Shared Types**: Common interfaces for environments, Hetzner API, and more
61
- - **Resource Parsing**: Utilities for parsing CPU, memory, disk, and GPU usage
62
- - **WebSocket Types**: Terminal WebSocket message types for real-time communication
63
- - **Validation**: Zod schemas for validating environment names, SSH keys, and API tokens
64
- - **Time Utilities**: Functions for formatting elapsed time
60
+ ### Types (`./types/*`)
61
+ - `index` - Main type exports (Environment, Hetzner types, etc.)
65
62
 
66
63
  ## License
67
64