-
Notifications
You must be signed in to change notification settings - Fork 22
/
index.d.ts
381 lines (381 loc) · 11.9 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
export type Openrpc = "1.3.2" | "1.3.1" | "1.3.0" | "1.2.6" | "1.2.5" | "1.2.4" | "1.2.3" | "1.2.2" | "1.2.1" | "1.2.0" | "1.1.12" | "1.1.11" | "1.1.10" | "1.1.9" | "1.1.8" | "1.1.7" | "1.1.6" | "1.1.5" | "1.1.4" | "1.1.3" | "1.1.2" | "1.1.1" | "1.1.0" | "1.0.0" | "1.0.0-rc1" | "1.0.0-rc0";
export type InfoObjectProperties = string;
export type InfoObjectDescription = string;
export type InfoObjectTermsOfService = string;
export type InfoObjectVersion = string;
export type ContactObjectName = string;
export type ContactObjectEmail = string;
export type ContactObjectUrl = string;
export type SpecificationExtension = any;
export interface ContactObject {
name?: ContactObjectName;
email?: ContactObjectEmail;
url?: ContactObjectUrl;
[regex: string]: SpecificationExtension | any;
}
export type LicenseObjectName = string;
export type LicenseObjectUrl = string;
export interface LicenseObject {
name?: LicenseObjectName;
url?: LicenseObjectUrl;
[regex: string]: SpecificationExtension | any;
}
export interface InfoObject {
title: InfoObjectProperties;
description?: InfoObjectDescription;
termsOfService?: InfoObjectTermsOfService;
version: InfoObjectVersion;
contact?: ContactObject;
license?: LicenseObject;
[regex: string]: SpecificationExtension | any;
}
export type ExternalDocumentationObjectDescription = string;
export type ExternalDocumentationObjectUrl = string;
/**
*
* information about external documentation
*
*/
export interface ExternalDocumentationObject {
description?: ExternalDocumentationObjectDescription;
url: ExternalDocumentationObjectUrl;
[regex: string]: SpecificationExtension | any;
}
export type ServerObjectUrl = string;
export type ServerObjectName = string;
export type ServerObjectDescription = string;
export type ServerObjectSummary = string;
export type ServerObjectVariableDefault = string;
export type ServerObjectVariableDescription = string;
export type ServerObjectVariableEnumItem = string;
export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[];
export interface ServerObjectVariable {
default: ServerObjectVariableDefault;
description?: ServerObjectVariableDescription;
enum?: ServerObjectVariableEnum;
[k: string]: any;
}
export interface ServerObjectVariables { [key: string]: any; }
export interface ServerObject {
url: ServerObjectUrl;
name?: ServerObjectName;
description?: ServerObjectDescription;
summary?: ServerObjectSummary;
variables?: ServerObjectVariables;
[regex: string]: SpecificationExtension | any;
}
type AlwaysFalse = any;
export type Servers = ServerObject[];
/**
*
* The cannonical name for the method. The name MUST be unique within the methods array.
*
*/
export type MethodObjectName = string;
/**
*
* A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation.
*
*/
export type MethodObjectDescription = string;
/**
*
* A short summary of what the method does.
*
*/
export type MethodObjectSummary = string;
export type TagObjectName = string;
export type TagObjectDescription = string;
export interface TagObject {
name: TagObjectName;
description?: TagObjectDescription;
externalDocs?: ExternalDocumentationObject;
[regex: string]: SpecificationExtension | any;
}
export type $Ref = string;
export interface ReferenceObject {
$ref: $Ref;
}
export type TagOrReference = TagObject | ReferenceObject;
export type MethodObjectTags = TagOrReference[];
/**
*
* Format the server expects the params. Defaults to 'either'.
*
* @default either
*
*/
export type MethodObjectParamStructure = "by-position" | "by-name" | "either";
export type ContentDescriptorObjectName = string;
export type ContentDescriptorObjectDescription = string;
export type ContentDescriptorObjectSummary = string;
export type $Id = string;
export type $Schema = string;
export type $Comment = string;
export type Title = string;
export type Description = string;
type AlwaysTrue = any;
export type ReadOnly = boolean;
export type Examples = AlwaysTrue[];
export type MultipleOf = number;
export type Maximum = number;
export type ExclusiveMaximum = number;
export type Minimum = number;
export type ExclusiveMinimum = number;
export type NonNegativeInteger = number;
export type NonNegativeIntegerDefaultZero = number;
export type Pattern = string;
export type SchemaArray = JSONSchema[];
/**
*
* @default true
*
*/
export type Items = JSONSchema | SchemaArray;
export type UniqueItems = boolean;
export type StringDoaGddGA = string;
/**
*
* @default []
*
*/
export type StringArray = StringDoaGddGA[];
/**
*
* @default {}
*
*/
export interface Definitions { [key: string]: any; }
/**
*
* @default {}
*
*/
export interface Properties { [key: string]: any; }
/**
*
* @default {}
*
*/
export interface PatternProperties { [key: string]: any; }
export type DependenciesSet = JSONSchema | StringArray;
export interface Dependencies { [key: string]: any; }
export type Enum = AlwaysTrue[];
export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string";
export type ArrayOfSimpleTypes = SimpleTypes[];
export type Type = SimpleTypes | ArrayOfSimpleTypes;
export type Format = string;
export type ContentMediaType = string;
export type ContentEncoding = string;
export interface JSONSchemaObject {
$id?: $Id;
$schema?: $Schema;
$ref?: $Ref;
$comment?: $Comment;
title?: Title;
description?: Description;
default?: AlwaysTrue;
readOnly?: ReadOnly;
examples?: Examples;
multipleOf?: MultipleOf;
maximum?: Maximum;
exclusiveMaximum?: ExclusiveMaximum;
minimum?: Minimum;
exclusiveMinimum?: ExclusiveMinimum;
maxLength?: NonNegativeInteger;
minLength?: NonNegativeIntegerDefaultZero;
pattern?: Pattern;
additionalItems?: JSONSchema;
items?: Items;
maxItems?: NonNegativeInteger;
minItems?: NonNegativeIntegerDefaultZero;
uniqueItems?: UniqueItems;
contains?: JSONSchema;
maxProperties?: NonNegativeInteger;
minProperties?: NonNegativeIntegerDefaultZero;
required?: StringArray;
additionalProperties?: JSONSchema;
definitions?: Definitions;
properties?: Properties;
patternProperties?: PatternProperties;
dependencies?: Dependencies;
propertyNames?: JSONSchema;
const?: AlwaysTrue;
enum?: Enum;
type?: Type;
format?: Format;
contentMediaType?: ContentMediaType;
contentEncoding?: ContentEncoding;
if?: JSONSchema;
then?: JSONSchema;
else?: JSONSchema;
allOf?: SchemaArray;
anyOf?: SchemaArray;
oneOf?: SchemaArray;
not?: JSONSchema;
[k: string]: any;
}
/**
*
* Always valid if true. Never valid if false. Is constant.
*
*/
export type JSONSchemaBoolean = boolean;
/**
*
* @default {}
*
*/
export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean;
export type ContentDescriptorObjectRequired = boolean;
export type ContentDescriptorObjectDeprecated = boolean;
export interface ContentDescriptorObject {
name: ContentDescriptorObjectName;
description?: ContentDescriptorObjectDescription;
summary?: ContentDescriptorObjectSummary;
schema: JSONSchema;
required?: ContentDescriptorObjectRequired;
deprecated?: ContentDescriptorObjectDeprecated;
[regex: string]: SpecificationExtension | any;
}
export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject;
export type MethodObjectParams = ContentDescriptorOrReference[];
export type MethodObjectResult = ContentDescriptorObject | ReferenceObject;
/**
*
* A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api.
*
*/
export type ErrorObjectCode = number;
/**
*
* A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.
*
*/
export type ErrorObjectMessage = string;
/**
*
* A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
*
*/
export type ErrorObjectData = any;
/**
*
* Defines an application level error.
*
*/
export interface ErrorObject {
code: ErrorObjectCode;
message: ErrorObjectMessage;
data?: ErrorObjectData;
}
export type ErrorOrReference = ErrorObject | ReferenceObject;
/**
*
* Defines an application level error.
*
*/
export type MethodObjectErrors = ErrorOrReference[];
export type LinkObjectName = string;
export type LinkObjectSummary = string;
export type LinkObjectMethod = string;
export type LinkObjectDescription = string;
export type LinkObjectParams = any;
export interface LinkObjectServer {
url: ServerObjectUrl;
name?: ServerObjectName;
description?: ServerObjectDescription;
summary?: ServerObjectSummary;
variables?: ServerObjectVariables;
[regex: string]: SpecificationExtension | any;
}
export interface LinkObject {
name?: LinkObjectName;
summary?: LinkObjectSummary;
method?: LinkObjectMethod;
description?: LinkObjectDescription;
params?: LinkObjectParams;
server?: LinkObjectServer;
[regex: string]: SpecificationExtension | any;
}
export type LinkOrReference = LinkObject | ReferenceObject;
export type MethodObjectLinks = LinkOrReference[];
export type ExamplePairingObjectName = string;
export type ExamplePairingObjectDescription = string;
export type ExampleObjectSummary = string;
export type ExampleObjectValue = any;
export type ExampleObjectDescription = string;
export type ExampleObjectName = string;
export interface ExampleObject {
summary?: ExampleObjectSummary;
value: ExampleObjectValue;
description?: ExampleObjectDescription;
name: ExampleObjectName;
[regex: string]: SpecificationExtension | any;
}
export type ExampleOrReference = ExampleObject | ReferenceObject;
export type ExamplePairingObjectParams = ExampleOrReference[];
export type ExamplePairingObjectResult = ExampleObject | ReferenceObject;
export interface ExamplePairingObject {
name: ExamplePairingObjectName;
description?: ExamplePairingObjectDescription;
params: ExamplePairingObjectParams;
result?: ExamplePairingObjectResult;
[k: string]: any;
}
export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject;
export type MethodObjectExamples = ExamplePairingOrReference[];
export type MethodObjectDeprecated = boolean;
export interface MethodObject {
name: MethodObjectName;
description?: MethodObjectDescription;
summary?: MethodObjectSummary;
servers?: Servers;
tags?: MethodObjectTags;
paramStructure?: MethodObjectParamStructure;
params: MethodObjectParams;
result?: MethodObjectResult;
errors?: MethodObjectErrors;
links?: MethodObjectLinks;
examples?: MethodObjectExamples;
deprecated?: MethodObjectDeprecated;
externalDocs?: ExternalDocumentationObject;
[regex: string]: SpecificationExtension | any;
}
export type MethodOrReference = MethodObject | ReferenceObject;
export type Methods = MethodOrReference[];
export interface SchemaComponents { [key: string]: any; }
export interface LinkComponents { [key: string]: any; }
export interface ErrorComponents { [key: string]: any; }
export interface ExampleComponents { [key: string]: any; }
export interface ExamplePairingComponents { [key: string]: any; }
export interface ContentDescriptorComponents { [key: string]: any; }
export interface TagComponents { [key: string]: any; }
export interface Components {
schemas?: SchemaComponents;
links?: LinkComponents;
errors?: ErrorComponents;
examples?: ExampleComponents;
examplePairings?: ExamplePairingComponents;
contentDescriptors?: ContentDescriptorComponents;
tags?: TagComponents;
[k: string]: any;
}
/**
*
* JSON Schema URI (used by some editors)
*
* @default https://meta.open-rpc.org/
*
*/
export type MetaSchema = string;
export interface OpenrpcDocument {
openrpc: Openrpc;
info: InfoObject;
externalDocs?: ExternalDocumentationObject;
servers?: Servers;
methods: Methods;
components?: Components;
$schema?: MetaSchema;
[regex: string]: SpecificationExtension | any;
}