@realforce-software/api-client 0.0.11
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/README.md +76 -0
- package/dist/client.generated.d.ts +2379 -0
- package/dist/client.generated.d.ts.map +1 -0
- package/dist/client.generated.js +3072 -0
- package/dist/client.generated.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
- package/src/client.generated.ts +5191 -0
- package/src/index.ts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Realforce API - TypeScript SDK
|
|
2
|
+
|
|
3
|
+
Auto-generated TypeScript / JavaScript client SDK for the Realforce API.
|
|
4
|
+
|
|
5
|
+
**Version:** 0.0.11
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @realforce-software/api-client
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { PropertyClient } from '@realforce-software/api-client';
|
|
17
|
+
|
|
18
|
+
const propertyClient = new PropertyClient({
|
|
19
|
+
baseURL: 'https://api.realforce.com',
|
|
20
|
+
headers: { Authorization: `Bearer ${yourJwtToken}` }
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const properties = await propertyClient.getProperties(hqId);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Authentication
|
|
27
|
+
|
|
28
|
+
The Realforce API uses JWT Bearer token authentication. Obtain a JWT
|
|
29
|
+
by authenticating with your AWS Cognito credentials through the Realforce
|
|
30
|
+
authentication system, and include it in the `Authorization` header.
|
|
31
|
+
|
|
32
|
+
## Error Handling
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
try {
|
|
36
|
+
const result = await client.someMethod();
|
|
37
|
+
} catch (error: any) {
|
|
38
|
+
if (error.response) {
|
|
39
|
+
console.error('Status:', error.response.status);
|
|
40
|
+
console.error('Body:', error.response.data);
|
|
41
|
+
} else if (error.request) {
|
|
42
|
+
console.error('No response received:', error.request);
|
|
43
|
+
} else {
|
|
44
|
+
console.error('Request error:', error.message);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Custom Axios Instance
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import axios from 'axios';
|
|
53
|
+
import { PropertyClient } from '@realforce-software/api-client';
|
|
54
|
+
|
|
55
|
+
const customAxios = axios.create({
|
|
56
|
+
baseURL: 'https://api.realforce.com',
|
|
57
|
+
timeout: 30000,
|
|
58
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const client = new PropertyClient({}, customAxios);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Requirements
|
|
65
|
+
|
|
66
|
+
- Node.js 16+ or a modern browser
|
|
67
|
+
- axios ^1.6.0
|
|
68
|
+
|
|
69
|
+
## Support
|
|
70
|
+
|
|
71
|
+
- Issues: https://github.com/adfenix/realforce-api-service/issues
|
|
72
|
+
- Or contact your Realforce API administrator
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
*This SDK was automatically generated. Do not edit the generated code directly.*
|