@chneau/hyperaccounts 0.0.4 → 0.0.6

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 (4) hide show
  1. package/README.md +40 -26
  2. package/index.d.ts +2541 -2541
  3. package/index.js +1 -1
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # @chneau/hyperaccounts
2
2
 
3
- A TypeScript client for the HyperAccounts REST API for Sage 50cloud, featuring type-safe requests and responses using Zod.
3
+ A TypeScript client for the HyperAccounts REST API for Sage 50cloud, featuring
4
+ type-safe requests and responses using Zod.
5
+
6
+ > **Caution**: This API client has been auto-generated through AI.
7
+
8
+ - **GitHub Repository**: https://github.com/chneau/hyperaccounts-js
9
+ - **NPM Package**: https://www.npmjs.com/package/@chneau/hyperaccounts
4
10
 
5
11
  ## Installation
6
12
 
@@ -22,14 +28,15 @@ Initialize the client with your HyperAccounts base URL and authentication token.
22
28
  import { HyperAccountsClient } from "@chneau/hyperaccounts";
23
29
 
24
30
  const client = new HyperAccountsClient({
25
- baseURL: "https://your-hyperaccounts-api-url.com",
26
- authToken: "YOUR_AUTH_TOKEN",
31
+ baseURL: "https://your-hyperaccounts-api-url.com",
32
+ authToken: "YOUR_AUTH_TOKEN",
27
33
  });
28
34
  ```
29
35
 
30
36
  ## Usage
31
37
 
32
- All API methods return a Promise that resolves to a typed response validated by Zod schemas.
38
+ All API methods return a Promise that resolves to a typed response validated by
39
+ Zod schemas.
33
40
 
34
41
  ### Check API Status
35
42
 
@@ -42,17 +49,17 @@ console.log(status);
42
49
 
43
50
  ```typescript
44
51
  const customers = await client.searchCustomer([
45
- {
46
- field: "name",
47
- type: "like",
48
- value: "Acme%",
49
- },
52
+ {
53
+ field: "name",
54
+ type: "like",
55
+ value: "Acme%",
56
+ },
50
57
  ]);
51
58
 
52
59
  if (customers.success && customers.results) {
53
- customers.results.forEach((customer) => {
54
- console.log(`Found customer: ${customer.name} (${customer.accountRef})`);
55
- });
60
+ customers.results.forEach((customer) => {
61
+ console.log(`Found customer: ${customer.name} (${customer.accountRef})`);
62
+ });
56
63
  }
57
64
  ```
58
65
 
@@ -67,27 +74,34 @@ console.log(customer.response);
67
74
 
68
75
  ```typescript
69
76
  const newOrder = await client.createSalesOrder({
70
- customerAccountRef: "ACME001",
71
- orderDate: "2023-10-27",
72
- invoiceItems: [
73
- {
74
- stockCode: "WIDGET-01",
75
- quantity: 10,
76
- unitPrice: 15.50,
77
- description: "Premium Widget",
78
- taxCode: 1,
79
- },
80
- ],
77
+ customerAccountRef: "ACME001",
78
+ orderDate: "2023-10-27",
79
+ invoiceItems: [
80
+ {
81
+ stockCode: "WIDGET-01",
82
+ quantity: 10,
83
+ unitPrice: 15.50,
84
+ description: "Premium Widget",
85
+ taxCode: 1,
86
+ },
87
+ ],
81
88
  });
82
89
 
83
90
  if (newOrder.success) {
84
- console.log(`Order created successfully: ${newOrder.response}`);
91
+ console.log(`Order created successfully: ${newOrder.response}`);
85
92
  }
86
93
  ```
87
94
 
88
95
  ## Features
89
96
 
90
97
  - **Type-Safe**: Full TypeScript definitions for inputs and outputs.
91
- - **Runtime Validation**: Uses [Zod](https://zod.dev) to validate API responses, ensuring your application handles data correctly.
98
+ - **Runtime Validation**: Uses [Zod](https://zod.dev) to validate API responses,
99
+ ensuring your application handles data correctly.
92
100
  - **Promise-Based**: Modern async/await API.
93
- - **Comprehensive Coverage**: Supports a wide range of HyperAccounts endpoints including Company Settings, Customers, Suppliers, Products, Stock, Sales Orders, Purchase Orders, and more.
101
+ - **Comprehensive Coverage**: Supports a wide range of HyperAccounts endpoints
102
+ including Company Settings, Customers, Suppliers, Products, Stock, Sales
103
+ Orders, Purchase Orders, and more.
104
+
105
+ ## License
106
+
107
+ MIT