1 | export interface Meta {
|
2 | api_version: string;
|
3 | query: {
|
4 | representation: string;
|
5 | };
|
6 | data_returned: number;
|
7 | data_available: number;
|
8 | more_data_available: boolean;
|
9 | implementation?: {
|
10 | maintainer: {
|
11 | email: string;
|
12 | };
|
13 | name: string;
|
14 | source_url: string;
|
15 | version: string;
|
16 | };
|
17 | provider?: {
|
18 | name: string;
|
19 | description: string;
|
20 | prefix: string;
|
21 | },
|
22 | pages?: number;
|
23 | limits?: number[];
|
24 | }
|
25 |
|
26 | export interface Links {
|
27 | base_url: string;
|
28 | first?: {
|
29 | href: string;
|
30 | };
|
31 | next?: {
|
32 | href: string;
|
33 | };
|
34 | }
|
35 |
|
36 | export interface ApiVer {
|
37 | url?: string;
|
38 | version?: string;
|
39 | [key: string]: string;
|
40 | }
|
41 |
|
42 | export interface Api {
|
43 | id: string;
|
44 | type: string;
|
45 | attributes: {
|
46 | api_version: string;
|
47 | available_api_versions: ApiVer | ApiVer[];
|
48 | available_endpoints: string[];
|
49 | entry_types_by_format: Record<string, unknown>;
|
50 | formats: string[];
|
51 | };
|
52 | }
|
53 |
|
54 | export interface Provider {
|
55 | type: string;
|
56 | id: string;
|
57 | attributes: {
|
58 | name: string;
|
59 | description: string;
|
60 | base_url: string | null;
|
61 | homepage?: string | null;
|
62 | link_type?: string;
|
63 | query_limits?: number[];
|
64 | api_version?: string;
|
65 | };
|
66 | }
|
67 |
|
68 | export interface Structure {
|
69 | type: string;
|
70 | id: string;
|
71 | attributes: {
|
72 | chemical_formula_hill?: string;
|
73 | chemical_formula_reduced?: string;
|
74 | _tcod_unreduced_formula?: string;
|
75 | chemical_formula_descriptive?: string;
|
76 | [key: string]: any;
|
77 | };
|
78 | }
|
79 |
|
80 | export interface ProvidersResponse {
|
81 | data: Provider[];
|
82 | meta?: Meta;
|
83 | }
|
84 |
|
85 | export interface InfoResponse {
|
86 | data: Api | Api[];
|
87 | links?: Links;
|
88 | meta?: Meta;
|
89 |
|
90 | [key: string]: any;
|
91 | }
|
92 |
|
93 | export interface StructuresResponse {
|
94 | data?: Structure[];
|
95 | links?: Links;
|
96 | meta?: Meta;
|
97 | }
|
98 |
|
99 | export interface LinksResponse {
|
100 | data: Structure[];
|
101 | links?: Links;
|
102 | meta?: Meta;
|
103 | }
|
104 |
|
105 | export interface ResponseError extends Error {
|
106 | response?: any;
|
107 | }
|
108 |
|
109 | export interface ErrorObject {
|
110 | status: string;
|
111 | title: string;
|
112 | detail?: string;
|
113 | length?: string;
|
114 | }
|
115 | export interface ErrorResponse {
|
116 | errors: ErrorObject;
|
117 | meta: any;
|
118 | }
|
119 |
|
120 | export type ProvidersMap = { [key: string]: Provider; };
|
121 | export type ApisMap = { [key: string]: Api[]; };
|
122 |
|
123 | export type StructuresResult = [Promise<StructuresResponse[]>, Promise<Provider>][];
|