@voucherify/sdk 2.0.10 → 2.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/CHANGELOG.md +6 -0
- package/README.md +6 -0
- package/dist/Orders.d.ts +5 -0
- package/dist/types/AsyncActions.d.ts +3 -0
- package/dist/voucherifysdk.esm.js +10 -2
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/dist/voucherifysdk.umd.development.js +10 -2
- package/dist/voucherifysdk.umd.development.js.map +1 -1
- package/dist/voucherifysdk.umd.production.min.js +1 -1
- package/dist/voucherifysdk.umd.production.min.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @voucherify/sdk
|
|
2
2
|
|
|
3
|
+
## 2.0.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ae6110b`](https://github.com/voucherifyio/voucherify-js-sdk/commit/ae6110b1ec8022c80a8f05f16e5c9de0e6cae180) [#137](https://github.com/voucherifyio/voucherify-js-sdk/pull/137) Thanks [@darekg11](https://github.com/darekg11)! - Added support for orders import API
|
|
8
|
+
|
|
3
9
|
## 2.0.10
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -645,6 +645,7 @@ Methods are provided within `client.orders.*` namespace.
|
|
|
645
645
|
- [Get Order](#get-order)
|
|
646
646
|
- [Update Order](#update-order)
|
|
647
647
|
- [List Orders](#list-orders)
|
|
648
|
+
- [Import Orders](#import-orders)
|
|
648
649
|
|
|
649
650
|
#### [Create Order](https://docs.voucherify.io/reference/create-order)
|
|
650
651
|
|
|
@@ -675,6 +676,11 @@ client.orders.list()
|
|
|
675
676
|
client.orders.list(params)
|
|
676
677
|
```
|
|
677
678
|
|
|
679
|
+
#### [Import Orders](https://docs.voucherify.io/reference/import-orders)
|
|
680
|
+
```javascript
|
|
681
|
+
client.orders.import(orders)
|
|
682
|
+
```
|
|
683
|
+
|
|
678
684
|
---
|
|
679
685
|
|
|
680
686
|
### Products
|
package/dist/Orders.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as T from './types/Orders';
|
|
2
|
+
import * as AAT from './types/AsyncActions';
|
|
2
3
|
import type { RequestController } from './RequestController';
|
|
3
4
|
export declare class Orders {
|
|
4
5
|
private client;
|
|
@@ -19,4 +20,8 @@ export declare class Orders {
|
|
|
19
20
|
* @see https://docs.voucherify.io/reference/list-orders
|
|
20
21
|
*/
|
|
21
22
|
list(params?: T.OrdersListParams): Promise<T.OrdersListResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* @see https://docs.voucherify.io/reference/import-orders
|
|
25
|
+
*/
|
|
26
|
+
import(orders: T.OrdersCreate[]): Promise<AAT.AsyncActionCreateResponse>;
|
|
22
27
|
}
|
|
@@ -15,4 +15,7 @@ export interface AsyncActionsListResponse {
|
|
|
15
15
|
data_ref: 'async_actions';
|
|
16
16
|
async_actions: Omit<AsyncActionsResponse, 'result'>[];
|
|
17
17
|
}
|
|
18
|
+
export interface AsyncActionCreateResponse {
|
|
19
|
+
async_action_id: string;
|
|
20
|
+
}
|
|
18
21
|
export declare type AsyncActionsGetResponse = AsyncActionsResponse;
|
|
@@ -869,6 +869,14 @@ class Orders {
|
|
|
869
869
|
list(params = {}) {
|
|
870
870
|
return this.client.get('/orders', params);
|
|
871
871
|
}
|
|
872
|
+
/**
|
|
873
|
+
* @see https://docs.voucherify.io/reference/import-orders
|
|
874
|
+
*/
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
import(orders) {
|
|
878
|
+
return this.client.post('/orders/import', orders);
|
|
879
|
+
}
|
|
872
880
|
|
|
873
881
|
}
|
|
874
882
|
|
|
@@ -1419,7 +1427,7 @@ function VoucherifyServerSide(options) {
|
|
|
1419
1427
|
let headers = {
|
|
1420
1428
|
'X-App-Id': options.applicationId,
|
|
1421
1429
|
'X-App-Token': options.secretKey,
|
|
1422
|
-
'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.0.
|
|
1430
|
+
'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.0.11"}`,
|
|
1423
1431
|
'Content-Type': 'application/json'
|
|
1424
1432
|
};
|
|
1425
1433
|
|
|
@@ -1668,7 +1676,7 @@ function VoucherifyClientSide(options) {
|
|
|
1668
1676
|
let headers = {
|
|
1669
1677
|
'X-Client-Application-Id': options.clientApplicationId,
|
|
1670
1678
|
'X-Client-Token': options.clientSecretKey,
|
|
1671
|
-
'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.0.
|
|
1679
|
+
'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.0.11"}`
|
|
1672
1680
|
};
|
|
1673
1681
|
|
|
1674
1682
|
if (environment().startsWith('Node')) {
|