@cinerino/sdk 5.3.0-alpha.0 → 5.3.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.
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as client from '../../lib/index';
|
|
3
|
+
import { auth } from './auth/clientCredentials';
|
|
4
|
+
|
|
5
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
const reservationService = new (await client.loadService()).Reservation({
|
|
9
|
+
endpoint: <string>process.env.API_ENDPOINT,
|
|
10
|
+
auth: await auth(),
|
|
11
|
+
project: { id: PROJECT_ID },
|
|
12
|
+
seller: { id: '' }
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const reservations = await reservationService.searchByOrder(
|
|
16
|
+
{
|
|
17
|
+
confirmationNumber: '36684',
|
|
18
|
+
orderNumber: 'CIN1-3743286-2441943'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
limit: 10,
|
|
22
|
+
page: 1,
|
|
23
|
+
typeOf: client.factory.reservationType.EventReservation
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
console.log(reservations.map((reservation) => `${reservation.id} ${reservation.reservationStatus}`));
|
|
27
|
+
console.log(reservations.length, 'reservations found');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
main()
|
|
31
|
+
.then(() => {
|
|
32
|
+
console.log('success!');
|
|
33
|
+
})
|
|
34
|
+
.catch(console.error);
|