@output.ai/http 0.1.1 → 0.1.2

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 (2) hide show
  1. package/README.md +3 -77
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -3,83 +3,9 @@
3
3
  HTTP client with built-in tracing for Output Framework workflows.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@output.ai/http)](https://www.npmjs.com/package/@output.ai/http)
6
- [![Documentation](https://img.shields.io/badge/docs-docs.output.ai-blue)](https://docs.output.ai/packages/http)
7
-
8
- ## Installation
9
-
10
- ```bash
11
- npm install @output.ai/http
12
- ```
13
-
14
- ## Quick Start
15
-
16
- ```typescript
17
- import { httpClient } from '@output.ai/http';
18
-
19
- const client = httpClient({
20
- prefixUrl: 'https://api.example.com'
21
- });
22
-
23
- const response = await client.get('users/1');
24
- const data = await response.json();
25
- ```
26
-
27
- ## HTTP Methods
28
-
29
- ```typescript
30
- // GET
31
- const users = await client.get('users').json();
32
-
33
- // POST
34
- const newUser = await client.post('users', {
35
- json: { name: 'John', email: 'john@example.com' }
36
- }).json();
37
-
38
- // PUT
39
- await client.put('users/1', {
40
- json: { name: 'Jane' }
41
- });
42
-
43
- // DELETE
44
- await client.delete('users/1');
45
- ```
46
-
47
- ## Using in Steps
48
-
49
- Wrap HTTP calls in steps for automatic retry and tracing:
50
-
51
- ```typescript
52
- import { step, z } from '@output.ai/core';
53
- import { httpClient } from '@output.ai/http';
54
-
55
- const api = httpClient({ prefixUrl: 'https://api.example.com' });
56
-
57
- export const fetchUser = step({
58
- name: 'fetchUser',
59
- inputSchema: z.string(),
60
- outputSchema: z.object({
61
- id: z.string(),
62
- name: z.string()
63
- }),
64
- fn: async (userId) => {
65
- return api.get(`users/${userId}`).json();
66
- }
67
- });
68
- ```
69
-
70
- ## Tracing
71
-
72
- All HTTP requests are automatically traced and visible in the Temporal UI, including request/response details and timing.
73
-
74
- ## Environment Variables
75
-
76
- | Variable | Description |
77
- |----------|-------------|
78
- | `LOG_HTTP_VERBOSE` | Set to `true` for detailed request/response logging |
79
6
 
80
7
  ## Documentation
8
+ - [README](https://docs.output.ai/packages/http)
9
+ - [API Reference](https://output-ai-reference-code-docs.onrender.com/modules/http_src.html)
81
10
 
82
- For comprehensive documentation, visit:
83
-
84
- - [Package Reference](https://docs.output.ai/packages/http)
85
- - [Getting Started](https://docs.output.ai/quickstart)
11
+ <!-- Internal Dev Note: The documentation for this package is found at docs/guides/packages/http.mdx -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@output.ai/http",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Framework abstraction to make HTTP calls with tracing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",