@arrowsphere/api-client 3.6.0 → 3.7.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
4
4
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## [3.7.0] - 2022-06-23
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- Adding new EndPoint of Customer orders:
|
|
11
|
+
- Get customer orders
|
|
12
|
+
|
|
6
13
|
## [3.6.0] - 2022-05-17
|
|
7
14
|
|
|
8
15
|
### Changed
|
|
@@ -2,11 +2,13 @@ import { AbstractClient, Parameters } from '../abstractClient';
|
|
|
2
2
|
import { GetResult } from '../getResult';
|
|
3
3
|
import { DataCustomers } from './entities/dataCustomers';
|
|
4
4
|
import { DataInvitation } from './entities/dataInvitation';
|
|
5
|
+
import { DataListOrders } from '../orders';
|
|
5
6
|
export declare class CustomersClient extends AbstractClient {
|
|
6
7
|
/**
|
|
7
|
-
* The base path of the
|
|
8
|
+
* The base path of the API
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
protected basePath: string;
|
|
10
11
|
getCustomers(parameters?: Parameters): Promise<GetResult<DataCustomers>>;
|
|
12
|
+
getCustomerOrders(customerRef: string, perPage?: number, page?: number, parameters?: Parameters): Promise<GetResult<DataListOrders>>;
|
|
11
13
|
getCustomerInvitation(codeInvitation: string, parameters?: Parameters): Promise<GetResult<DataInvitation>>;
|
|
12
14
|
}
|
|
@@ -5,20 +5,26 @@ const abstractClient_1 = require("../abstractClient");
|
|
|
5
5
|
const getResult_1 = require("../getResult");
|
|
6
6
|
const dataCustomers_1 = require("./entities/dataCustomers");
|
|
7
7
|
const dataInvitation_1 = require("./entities/dataInvitation");
|
|
8
|
+
const orders_1 = require("../orders");
|
|
8
9
|
class CustomersClient extends abstractClient_1.AbstractClient {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
12
|
/**
|
|
12
|
-
* The base path of the
|
|
13
|
+
* The base path of the API
|
|
13
14
|
*/
|
|
14
|
-
this.
|
|
15
|
+
this.basePath = '/customers';
|
|
15
16
|
}
|
|
16
17
|
async getCustomers(parameters = {}) {
|
|
17
|
-
this.path = this.ROOT_PATH;
|
|
18
18
|
return new getResult_1.GetResult(dataCustomers_1.DataCustomers, await this.get(parameters));
|
|
19
19
|
}
|
|
20
|
+
async getCustomerOrders(customerRef, perPage = 25, page = 1, parameters = {}) {
|
|
21
|
+
this.setPerPage(perPage);
|
|
22
|
+
this.setPage(page);
|
|
23
|
+
this.path = `/${customerRef}/orders`;
|
|
24
|
+
return new getResult_1.GetResult(orders_1.DataListOrders, await this.get(parameters));
|
|
25
|
+
}
|
|
20
26
|
async getCustomerInvitation(codeInvitation, parameters = {}) {
|
|
21
|
-
this.path =
|
|
27
|
+
this.path = `/invitations/${codeInvitation}`;
|
|
22
28
|
return new getResult_1.GetResult(dataInvitation_1.DataInvitation, await this.get(parameters));
|
|
23
29
|
}
|
|
24
30
|
}
|
package/package.json
CHANGED