@ocxp/client 0.2.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.
- package/LICENSE +21 -0
- package/README.md +103 -0
- package/dist/index.cjs +4141 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +9268 -0
- package/dist/index.d.ts +9268 -0
- package/dist/index.js +3913 -0
- package/dist/index.js.map +1 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OCXP
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# @ocxp/client
|
|
2
|
+
|
|
3
|
+
TypeScript client for the OCXP (Open Context Exchange Protocol).
|
|
4
|
+
|
|
5
|
+
This package is auto-generated from the OpenAPI specification and provides type-safe access to the OCXP API.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @ocxp/client
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { Client } from '@ocxp/client';
|
|
17
|
+
|
|
18
|
+
// Create a client instance
|
|
19
|
+
const client = new Client({
|
|
20
|
+
baseUrl: 'http://localhost:8000'
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Example: List projects
|
|
24
|
+
const { data: projects } = await client.GET('/ocxp/project');
|
|
25
|
+
console.log(projects);
|
|
26
|
+
|
|
27
|
+
// Example: Get a specific project
|
|
28
|
+
const { data: project } = await client.GET('/ocxp/project/{project_id}', {
|
|
29
|
+
params: {
|
|
30
|
+
path: {
|
|
31
|
+
project_id: 'my-project-id'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Example: Create a new mission
|
|
37
|
+
const { data: mission } = await client.POST('/ocxp/mission', {
|
|
38
|
+
body: {
|
|
39
|
+
name: 'My Mission',
|
|
40
|
+
description: 'Mission description',
|
|
41
|
+
project_id: 'my-project-id'
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Features
|
|
47
|
+
|
|
48
|
+
- **Type-safe**: Full TypeScript support with auto-generated types from OpenAPI spec
|
|
49
|
+
- **Zod validation**: Runtime type validation using Zod schemas
|
|
50
|
+
- **Fetch-based**: Uses modern Fetch API for HTTP requests
|
|
51
|
+
- **Tree-shakeable**: ESM and CJS bundles for optimal bundle size
|
|
52
|
+
|
|
53
|
+
## API Coverage
|
|
54
|
+
|
|
55
|
+
The client provides access to all OCXP API endpoints:
|
|
56
|
+
|
|
57
|
+
- **Projects**: Create, list, update, and delete projects
|
|
58
|
+
- **Missions**: Manage missions and their lifecycle
|
|
59
|
+
- **Context**: Store and retrieve context documents
|
|
60
|
+
- **Memos**: Add feedback and annotations to documents
|
|
61
|
+
- **Repositories**: Connect and manage code repositories
|
|
62
|
+
- **Databases**: Configure database connections
|
|
63
|
+
|
|
64
|
+
## Documentation
|
|
65
|
+
|
|
66
|
+
For full API documentation, see the [OpenAPI specification](openapi.json) included in this package.
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
This package is auto-generated using [@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts).
|
|
71
|
+
|
|
72
|
+
### Regenerating the Client
|
|
73
|
+
|
|
74
|
+
If you need to regenerate the client from an updated OpenAPI spec:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm run generate
|
|
78
|
+
npm run build
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Building
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm run build
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Testing
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm run test
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
MIT
|
|
96
|
+
|
|
97
|
+
## Contributing
|
|
98
|
+
|
|
99
|
+
This is an auto-generated package. Please report issues or suggest improvements to the OCXP OpenAPI specification.
|
|
100
|
+
|
|
101
|
+
## Support
|
|
102
|
+
|
|
103
|
+
For questions or support, please open an issue on the [GitHub repository](https://github.com/OCXP/client-ts/issues).
|