@atomsolution/invoice-sdk-api 1.20.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/README.md +123 -0
- package/dist/api.d.ts +1780 -0
- package/dist/assets/fpt.svg +9 -0
- package/dist/assets/m-invoice.svg +9 -0
- package/dist/assets/misa.svg +9 -0
- package/dist/auth.d.ts +41 -0
- package/dist/base.d.ts +54 -0
- package/dist/common.d.ts +54 -0
- package/dist/configuration.d.ts +92 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +1721 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Invoice SDK API
|
|
2
|
+
|
|
3
|
+
A TypeScript SDK for invoice management APIs supporting multiple providers.
|
|
4
|
+
|
|
5
|
+
All URIs are relative to Invoice Hub
|
|
6
|
+
Document *https://stag-invoice-docs.atomsolution.vn/docs/intro*
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
### NPM Package
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @invoice-sdk/api
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### CDN Usage
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<!-- Include dependencies -->
|
|
20
|
+
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
|
21
|
+
<script src="https://unpkg.com/crypto-js/crypto-js.js"></script>
|
|
22
|
+
|
|
23
|
+
<!-- Include the SDK -->
|
|
24
|
+
<script src="https://unpkg.com/@invoice-sdk/api@latest/dist/index.umd.js"></script>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
// SDK is available as window.InvoiceSDK
|
|
28
|
+
const { Configuration, Provider } = window.InvoiceSDK;
|
|
29
|
+
</script>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
### ES Modules (Node.js/Modern Browsers)
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { Configuration, Provider, InvoiceApi } from '@invoice-sdk/api';
|
|
38
|
+
|
|
39
|
+
const config = new Configuration({
|
|
40
|
+
provider: Provider.MInvoice,
|
|
41
|
+
apiKey: 'your-api-key',
|
|
42
|
+
basePath: 'https://api.example.com'
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const invoiceApi = new InvoiceApi(config);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### CommonJS (Node.js)
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
const { Configuration, Provider, InvoiceApi } = require('@invoice-sdk/api');
|
|
52
|
+
|
|
53
|
+
const config = new Configuration({
|
|
54
|
+
provider: Provider.MInvoice,
|
|
55
|
+
apiKey: 'your-api-key',
|
|
56
|
+
basePath: 'https://api.example.com'
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const invoiceApi = new InvoiceApi(config);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Browser UMD
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<script src="https://unpkg.com/@invoice-sdk/api@latest/dist/index.umd.js"></script>
|
|
66
|
+
<script>
|
|
67
|
+
const { Configuration, Provider, InvoiceApi } = window.InvoiceSDK;
|
|
68
|
+
|
|
69
|
+
const config = new Configuration({
|
|
70
|
+
provider: Provider.MInvoice,
|
|
71
|
+
apiKey: 'your-api-key',
|
|
72
|
+
basePath: 'https://api.example.com'
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const invoiceApi = new InvoiceApi(config);
|
|
76
|
+
</script>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Supported Providers
|
|
80
|
+
|
|
81
|
+
- **M-Invoice**: `Provider.MInvoice`
|
|
82
|
+
- **FPT**: `Provider.FPT`
|
|
83
|
+
- **MISA**: `Provider.MISA`
|
|
84
|
+
|
|
85
|
+
## Development
|
|
86
|
+
|
|
87
|
+
### Build
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm run build
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Development Mode (Watch)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm run dev
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Preview
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run preview
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Package Exports
|
|
106
|
+
|
|
107
|
+
The package provides multiple build formats:
|
|
108
|
+
|
|
109
|
+
- **ES Module**: `dist/index.esm.js` (for modern bundlers)
|
|
110
|
+
- **CommonJS**: `dist/index.js` (for Node.js)
|
|
111
|
+
- **UMD**: `dist/index.umd.js` (for browsers via CDN)
|
|
112
|
+
- **Types**: `dist/index.d.ts` (TypeScript definitions)
|
|
113
|
+
|
|
114
|
+
## CDN Links
|
|
115
|
+
|
|
116
|
+
You can use the package directly from CDN services:
|
|
117
|
+
|
|
118
|
+
- **unpkg**: `https://unpkg.com/@invoice-sdk/api@latest/dist/index.umd.js`
|
|
119
|
+
- **jsDelivr**: `https://cdn.jsdelivr.net/npm/@invoice-sdk/api@latest/dist/index.umd.js`
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
MIT
|