@emmvish/stable-request 1.1.7 → 1.1.8

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 +14 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -29,11 +29,23 @@ npm install @emmvish/stable-request
29
29
  ```typescript
30
30
  import { stableRequest } from '@emmvish/stable-request';
31
31
 
32
+ interface RequestBodyParams {
33
+ page: number,
34
+ offset: number
35
+ }
36
+
37
+ interface ResponseParams {
38
+ id: number,
39
+ name: string
40
+ }
41
+
32
42
  const getStableResponse = async () => {
33
- const data = await stableRequest({
43
+ const data = await stableRequest<RequestBodyParams, ResponseParams>({
34
44
  reqData: {
35
45
  hostname: 'api.example.com',
36
- path: '/users/123'
46
+ path: '/users/123',
47
+ headers: { Authorization: `Bearer ${token}` }
48
+ body: { page: 10, offset: 5 }
37
49
  },
38
50
  resReq: true // Return the response data
39
51
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emmvish/stable-request",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "stable-request is a TypeScript-first HTTP reliability toolkit for workflow-driven API integrations, that goes beyond status-code retries by validating response content, handling eventual consistency, coordinating batch workflows with intelligent grouping, and providing deep observability into every request attempt. It is designed for real-world distributed systems where HTTP success does not guarantee business success. It also provides extensive support for managing multiple requests so as to achieve workflow automation.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",