on 9a5e76d help sign in
bridge/src/lib/SolarisClient.js
87 lines 1.8 kB history raw
1/* eslint-disable prettier/prettier */
3//
4// Warning: this file is auto-generated.
5//
7export default class SolarisClient {
8 constructor(endpoint) {
9 this.endpoint = endpoint;
10 }
12 async getHealthz() {
13 return await fetch(this.endpoint + '/healthz', {
14 method: 'GET',
15 headers: {
16 'Accept': 'application/json',
17 },
18 });
19 }
21 async get() {
22 return await fetch(this.endpoint + '/', {
23 method: 'GET',
24 headers: {
25 'Accept': 'application/json',
26 },
27 });
28 }
30 async getImages() {
31 return await fetch(this.endpoint + '/images', {
32 method: 'GET',
33 headers: {
34 'Accept': 'application/json',
35 },
36 });
37 }
39 async getShips() {
40 return await fetch(this.endpoint + '/ships', {
41 method: 'GET',
42 headers: {
43 'Accept': 'application/json',
44 },
45 });
46 }
48 async getShipsByPatp(patp) {
49 return await fetch(this.endpoint + '/ships/' + encodeURIComponent(patp) + '', {
50 method: 'GET',
51 headers: {
52 'Accept': 'application/json',
53 },
54 });
55 }
57 async getShipsByPatpDetails(patp) {
58 return await fetch(this.endpoint + '/ships/' + encodeURIComponent(patp) + '/details', {
59 method: 'GET',
60 headers: {
61 'Accept': 'application/json',
62 },
63 });
64 }
66 async getShipsByPatpEvents(patp) {
67 return await fetch(this.endpoint + '/ships/' + encodeURIComponent(patp) + '/events', {
68 method: 'GET',
69 headers: {
70 'Accept': 'application/json',
71 },
72 });
73 }
75 async postShips(data) {
76 return await fetch(this.endpoint + '/ships', {
77 method: 'POST',
78 cache: 'no-cache',
79 body: JSON.stringify(data),
80 headers: {
81 'Accept': 'application/json',
82 'Content-Type': 'application/json',
83 },
84 });
85 }