@xyo-network/api-models 5.3.25 → 5.3.26
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/README.md +570 -10
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,23 +1,583 @@
|
|
|
1
|
+
[![logo][]](https://xyo.network)
|
|
2
|
+
|
|
1
3
|
# @xyo-network/api-models
|
|
2
4
|
|
|
3
|
-
[![
|
|
5
|
+
[![npm][npm-badge]][npm-link]
|
|
6
|
+
[![license][license-badge]][license-link]
|
|
7
|
+
|
|
8
|
+
> Primary SDK for using XYO Protocol 2.0
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
Using npm:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install {{name}}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Using yarn:
|
|
4
19
|
|
|
5
|
-
|
|
20
|
+
```sh
|
|
21
|
+
yarn add {{name}}
|
|
22
|
+
```
|
|
6
23
|
|
|
7
|
-
|
|
24
|
+
Using pnpm:
|
|
8
25
|
|
|
9
|
-
|
|
26
|
+
```sh
|
|
27
|
+
pnpm add {{name}}
|
|
28
|
+
```
|
|
10
29
|
|
|
11
|
-
|
|
30
|
+
Using bun:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
bun add {{name}}
|
|
34
|
+
```
|
|
12
35
|
|
|
13
|
-
Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)
|
|
14
36
|
|
|
15
37
|
## License
|
|
16
38
|
|
|
17
|
-
|
|
39
|
+
See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
|
|
40
|
+
|
|
41
|
+
## Reference
|
|
42
|
+
|
|
43
|
+
### packages
|
|
44
|
+
|
|
45
|
+
### sdk-utils
|
|
46
|
+
|
|
47
|
+
### packages
|
|
48
|
+
|
|
49
|
+
### api-models
|
|
50
|
+
|
|
51
|
+
### .temp-typedoc
|
|
52
|
+
|
|
53
|
+
### interfaces
|
|
54
|
+
|
|
55
|
+
### <a id="ApiConfig"></a>ApiConfig
|
|
56
|
+
|
|
57
|
+
[**@xyo-network/api-models**](#../README)
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
## Extends
|
|
62
|
+
|
|
63
|
+
- [`ApiReportable`](#ApiReportable)
|
|
64
|
+
|
|
65
|
+
## Properties
|
|
66
|
+
|
|
67
|
+
### apiDomain
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
apiDomain: string;
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Description
|
|
74
|
+
|
|
75
|
+
The domain where the api is located
|
|
76
|
+
|
|
77
|
+
***
|
|
78
|
+
|
|
79
|
+
### apiKey?
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
optional apiKey?: string;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Description
|
|
86
|
+
|
|
87
|
+
The apiKey used for authentication
|
|
88
|
+
|
|
89
|
+
***
|
|
90
|
+
|
|
91
|
+
### compressionThreshold?
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
optional compressionThreshold?: number;
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Description
|
|
98
|
+
|
|
99
|
+
Threshold for Content-Size to cause automatic gzip of request body [default = 1024]
|
|
100
|
+
|
|
101
|
+
***
|
|
102
|
+
|
|
103
|
+
### jwtToken?
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
optional jwtToken?: string;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Description
|
|
110
|
+
|
|
111
|
+
The jwtToken of the currently logged in user
|
|
112
|
+
|
|
113
|
+
***
|
|
114
|
+
|
|
115
|
+
### query?
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
optional query?: string;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Description
|
|
122
|
+
|
|
123
|
+
The query string, if any, that is added to the end of every request
|
|
124
|
+
|
|
125
|
+
***
|
|
126
|
+
|
|
127
|
+
### reportableParent?
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
optional reportableParent?: ApiReportable;
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Description
|
|
134
|
+
|
|
135
|
+
Parent that should also report events from this api
|
|
136
|
+
|
|
137
|
+
***
|
|
138
|
+
|
|
139
|
+
### root?
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
optional root?: string;
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Description
|
|
146
|
+
|
|
147
|
+
The location in the API tree where this API object is mounted
|
|
148
|
+
|
|
149
|
+
***
|
|
150
|
+
|
|
151
|
+
### throwError?
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
optional throwError?: boolean;
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Description
|
|
158
|
+
|
|
159
|
+
Throw on error
|
|
160
|
+
|
|
161
|
+
***
|
|
162
|
+
|
|
163
|
+
### throwFailure?
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
optional throwFailure?: boolean;
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Description
|
|
170
|
+
|
|
171
|
+
Throw on failures
|
|
172
|
+
|
|
173
|
+
***
|
|
174
|
+
|
|
175
|
+
### ~~userid?~~
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
optional userid?: string;
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Deprecated
|
|
182
|
+
|
|
183
|
+
use the jwtToken instead
|
|
184
|
+
|
|
185
|
+
***
|
|
186
|
+
|
|
187
|
+
### onError?
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
optional onError?: (error, depth) => void;
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Parameters
|
|
194
|
+
|
|
195
|
+
#### error
|
|
196
|
+
|
|
197
|
+
[`ApiError`](#ApiError)
|
|
198
|
+
|
|
199
|
+
#### depth
|
|
200
|
+
|
|
201
|
+
`number`
|
|
202
|
+
|
|
203
|
+
### Returns
|
|
204
|
+
|
|
205
|
+
`void`
|
|
206
|
+
|
|
207
|
+
### Inherited from
|
|
208
|
+
|
|
209
|
+
[`ApiReportable`](#ApiReportable).[`onError`](ApiReportable.md#onerror)
|
|
210
|
+
|
|
211
|
+
***
|
|
212
|
+
|
|
213
|
+
### onFailure?
|
|
214
|
+
|
|
215
|
+
```ts
|
|
216
|
+
optional onFailure?: (response, depth) => void;
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Parameters
|
|
220
|
+
|
|
221
|
+
#### response
|
|
222
|
+
|
|
223
|
+
[`ApiResponse`](#../type-aliases/ApiResponse)
|
|
224
|
+
|
|
225
|
+
#### depth
|
|
226
|
+
|
|
227
|
+
`number`
|
|
228
|
+
|
|
229
|
+
### Returns
|
|
230
|
+
|
|
231
|
+
`void`
|
|
232
|
+
|
|
233
|
+
### Inherited from
|
|
234
|
+
|
|
235
|
+
[`ApiReportable`](#ApiReportable).[`onFailure`](ApiReportable.md#onfailure)
|
|
236
|
+
|
|
237
|
+
***
|
|
238
|
+
|
|
239
|
+
### onSuccess?
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
optional onSuccess?: (response, depth) => void;
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Parameters
|
|
246
|
+
|
|
247
|
+
#### response
|
|
248
|
+
|
|
249
|
+
[`ApiResponse`](#../type-aliases/ApiResponse)
|
|
250
|
+
|
|
251
|
+
#### depth
|
|
252
|
+
|
|
253
|
+
`number`
|
|
254
|
+
|
|
255
|
+
### Returns
|
|
256
|
+
|
|
257
|
+
`void`
|
|
258
|
+
|
|
259
|
+
### Inherited from
|
|
260
|
+
|
|
261
|
+
[`ApiReportable`](#ApiReportable).[`onSuccess`](ApiReportable.md#onsuccess)
|
|
262
|
+
|
|
263
|
+
### <a id="ApiEnvelopeBase"></a>ApiEnvelopeBase
|
|
264
|
+
|
|
265
|
+
[**@xyo-network/api-models**](#../README)
|
|
266
|
+
|
|
267
|
+
***
|
|
268
|
+
|
|
269
|
+
## Extended by
|
|
270
|
+
|
|
271
|
+
- [`ApiEnvelopeSuccess`](#ApiEnvelopeSuccess)
|
|
272
|
+
- [`ApiEnvelopeError`](#ApiEnvelopeError)
|
|
273
|
+
|
|
274
|
+
## Properties
|
|
275
|
+
|
|
276
|
+
### warning?
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
optional warning?: Error[];
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### <a id="ApiEnvelopeError"></a>ApiEnvelopeError
|
|
283
|
+
|
|
284
|
+
[**@xyo-network/api-models**](#../README)
|
|
285
|
+
|
|
286
|
+
***
|
|
287
|
+
|
|
288
|
+
## Extends
|
|
289
|
+
|
|
290
|
+
- [`ApiEnvelopeBase`](#ApiEnvelopeBase)
|
|
291
|
+
|
|
292
|
+
## Properties
|
|
293
|
+
|
|
294
|
+
### warning?
|
|
295
|
+
|
|
296
|
+
```ts
|
|
297
|
+
optional warning?: Error[];
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Inherited from
|
|
301
|
+
|
|
302
|
+
[`ApiEnvelopeBase`](#ApiEnvelopeBase).[`warning`](ApiEnvelopeBase.md#warning)
|
|
303
|
+
|
|
304
|
+
***
|
|
305
|
+
|
|
306
|
+
### data
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
data: never;
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
***
|
|
313
|
+
|
|
314
|
+
### errors
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
errors: ApiError<any, any>[];
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### <a id="ApiEnvelopeSuccess"></a>ApiEnvelopeSuccess
|
|
321
|
+
|
|
322
|
+
[**@xyo-network/api-models**](#../README)
|
|
323
|
+
|
|
324
|
+
***
|
|
325
|
+
|
|
326
|
+
## Extends
|
|
327
|
+
|
|
328
|
+
- [`ApiEnvelopeBase`](#ApiEnvelopeBase)
|
|
329
|
+
|
|
330
|
+
## Type Parameters
|
|
331
|
+
|
|
332
|
+
### T
|
|
333
|
+
|
|
334
|
+
`T`
|
|
335
|
+
|
|
336
|
+
## Properties
|
|
337
|
+
|
|
338
|
+
### warning?
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
optional warning?: Error[];
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Inherited from
|
|
345
|
+
|
|
346
|
+
[`ApiEnvelopeBase`](#ApiEnvelopeBase).[`warning`](ApiEnvelopeBase.md#warning)
|
|
347
|
+
|
|
348
|
+
***
|
|
349
|
+
|
|
350
|
+
### data
|
|
351
|
+
|
|
352
|
+
```ts
|
|
353
|
+
data: T;
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
***
|
|
357
|
+
|
|
358
|
+
### errors
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
errors: never;
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### <a id="ApiError"></a>ApiError
|
|
365
|
+
|
|
366
|
+
[**@xyo-network/api-models**](#../README)
|
|
367
|
+
|
|
368
|
+
***
|
|
369
|
+
|
|
370
|
+
## Extends
|
|
371
|
+
|
|
372
|
+
- `AxiosError`\<`T`, `D`\>
|
|
373
|
+
|
|
374
|
+
## Type Parameters
|
|
375
|
+
|
|
376
|
+
### T
|
|
377
|
+
|
|
378
|
+
`T` = `any`
|
|
379
|
+
|
|
380
|
+
### D
|
|
381
|
+
|
|
382
|
+
`D` = `any`
|
|
383
|
+
|
|
384
|
+
## Properties
|
|
385
|
+
|
|
386
|
+
### isError
|
|
387
|
+
|
|
388
|
+
```ts
|
|
389
|
+
isError: true;
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### <a id="ApiReportable"></a>ApiReportable
|
|
393
|
+
|
|
394
|
+
[**@xyo-network/api-models**](#../README)
|
|
395
|
+
|
|
396
|
+
***
|
|
397
|
+
|
|
398
|
+
## Extended by
|
|
399
|
+
|
|
400
|
+
- [`ApiConfig`](#ApiConfig)
|
|
401
|
+
|
|
402
|
+
## Properties
|
|
403
|
+
|
|
404
|
+
### onError?
|
|
405
|
+
|
|
406
|
+
```ts
|
|
407
|
+
optional onError?: (error, depth) => void;
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Parameters
|
|
411
|
+
|
|
412
|
+
#### error
|
|
413
|
+
|
|
414
|
+
[`ApiError`](#ApiError)
|
|
415
|
+
|
|
416
|
+
#### depth
|
|
417
|
+
|
|
418
|
+
`number`
|
|
419
|
+
|
|
420
|
+
### Returns
|
|
421
|
+
|
|
422
|
+
`void`
|
|
423
|
+
|
|
424
|
+
***
|
|
425
|
+
|
|
426
|
+
### onFailure?
|
|
427
|
+
|
|
428
|
+
```ts
|
|
429
|
+
optional onFailure?: (response, depth) => void;
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Parameters
|
|
433
|
+
|
|
434
|
+
#### response
|
|
435
|
+
|
|
436
|
+
[`ApiResponse`](#../type-aliases/ApiResponse)
|
|
437
|
+
|
|
438
|
+
#### depth
|
|
439
|
+
|
|
440
|
+
`number`
|
|
441
|
+
|
|
442
|
+
### Returns
|
|
443
|
+
|
|
444
|
+
`void`
|
|
445
|
+
|
|
446
|
+
***
|
|
447
|
+
|
|
448
|
+
### onSuccess?
|
|
449
|
+
|
|
450
|
+
```ts
|
|
451
|
+
optional onSuccess?: (response, depth) => void;
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### Parameters
|
|
455
|
+
|
|
456
|
+
#### response
|
|
457
|
+
|
|
458
|
+
[`ApiResponse`](#../type-aliases/ApiResponse)
|
|
459
|
+
|
|
460
|
+
#### depth
|
|
461
|
+
|
|
462
|
+
`number`
|
|
463
|
+
|
|
464
|
+
### Returns
|
|
465
|
+
|
|
466
|
+
`void`
|
|
467
|
+
|
|
468
|
+
### type-aliases
|
|
469
|
+
|
|
470
|
+
### <a id="ApiEnvelope"></a>ApiEnvelope
|
|
471
|
+
|
|
472
|
+
[**@xyo-network/api-models**](#../README)
|
|
473
|
+
|
|
474
|
+
***
|
|
475
|
+
|
|
476
|
+
```ts
|
|
477
|
+
type ApiEnvelope<T> =
|
|
478
|
+
| ApiEnvelopeSuccess<T>
|
|
479
|
+
| ApiEnvelopeError;
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
## Type Parameters
|
|
483
|
+
|
|
484
|
+
### T
|
|
485
|
+
|
|
486
|
+
`T`
|
|
487
|
+
|
|
488
|
+
### <a id="ApiResponse"></a>ApiResponse
|
|
489
|
+
|
|
490
|
+
[**@xyo-network/api-models**](#../README)
|
|
491
|
+
|
|
492
|
+
***
|
|
493
|
+
|
|
494
|
+
```ts
|
|
495
|
+
type ApiResponse<T, D> = AxiosResponse<T, D>;
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
## Type Parameters
|
|
499
|
+
|
|
500
|
+
### T
|
|
501
|
+
|
|
502
|
+
`T` = `unknown`
|
|
503
|
+
|
|
504
|
+
### D
|
|
505
|
+
|
|
506
|
+
`D` = `unknown`
|
|
507
|
+
|
|
508
|
+
### <a id="ApiResponseBody"></a>ApiResponseBody
|
|
509
|
+
|
|
510
|
+
[**@xyo-network/api-models**](#../README)
|
|
511
|
+
|
|
512
|
+
***
|
|
513
|
+
|
|
514
|
+
```ts
|
|
515
|
+
type ApiResponseBody<T> = T | undefined;
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
## Type Parameters
|
|
519
|
+
|
|
520
|
+
### T
|
|
521
|
+
|
|
522
|
+
`T`
|
|
523
|
+
|
|
524
|
+
### <a id="ApiResponseTuple"></a>ApiResponseTuple
|
|
525
|
+
|
|
526
|
+
[**@xyo-network/api-models**](#../README)
|
|
527
|
+
|
|
528
|
+
***
|
|
529
|
+
|
|
530
|
+
```ts
|
|
531
|
+
type ApiResponseTuple<T> = [T | undefined, ApiEnvelope<T | undefined>, ApiResponse<ApiEnvelope<T | undefined>>];
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
## Type Parameters
|
|
535
|
+
|
|
536
|
+
### T
|
|
537
|
+
|
|
538
|
+
`T`
|
|
539
|
+
|
|
540
|
+
### <a id="ApiResponseTupleOrBody"></a>ApiResponseTupleOrBody
|
|
541
|
+
|
|
542
|
+
[**@xyo-network/api-models**](#../README)
|
|
543
|
+
|
|
544
|
+
***
|
|
545
|
+
|
|
546
|
+
```ts
|
|
547
|
+
type ApiResponseTupleOrBody<T> =
|
|
548
|
+
| ApiResponseTuple<T>
|
|
549
|
+
| ApiResponseBody<T>;
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
## Type Parameters
|
|
553
|
+
|
|
554
|
+
### T
|
|
555
|
+
|
|
556
|
+
`T`
|
|
557
|
+
|
|
558
|
+
### <a id="ApiResponseType"></a>ApiResponseType
|
|
559
|
+
|
|
560
|
+
[**@xyo-network/api-models**](#../README)
|
|
561
|
+
|
|
562
|
+
***
|
|
563
|
+
|
|
564
|
+
```ts
|
|
565
|
+
type ApiResponseType = "body" | "tuple";
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### <a id="ApiWarning"></a>ApiWarning
|
|
569
|
+
|
|
570
|
+
[**@xyo-network/api-models**](#../README)
|
|
571
|
+
|
|
572
|
+
***
|
|
18
573
|
|
|
19
|
-
|
|
574
|
+
```ts
|
|
575
|
+
type ApiWarning = Error;
|
|
576
|
+
```
|
|
20
577
|
|
|
21
|
-
[Made with 🔥 and ❄️ by XYO](https://xyo.network)
|
|
22
578
|
|
|
23
|
-
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
579
|
+
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
580
|
+
[npm-badge]: https://img.shields.io/npm/v/@xyo-network/api-models.svg
|
|
581
|
+
[npm-link]: https://www.npmjs.com/package/@xyo-network/api-models
|
|
582
|
+
[license-badge]: https://img.shields.io/npm/l/@xyo-network/api-models.svg
|
|
583
|
+
[license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/api-models",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.26",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"types": "./dist/neutral/index.d.ts",
|
|
25
|
+
"import": "./dist/neutral/index.mjs",
|
|
25
26
|
"default": "./dist/neutral/index.mjs"
|
|
26
27
|
},
|
|
27
28
|
"./package.json": "./package.json"
|
|
28
29
|
},
|
|
29
|
-
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"README.md"
|
|
37
37
|
],
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "^25.5.
|
|
40
|
-
"@xylabs/ts-scripts-common": "~7.
|
|
41
|
-
"@xylabs/ts-scripts-pnpm": "~7.
|
|
42
|
-
"@xylabs/tsconfig": "~7.
|
|
39
|
+
"@types/node": "^25.5.2",
|
|
40
|
+
"@xylabs/ts-scripts-common": "~7.7.5",
|
|
41
|
+
"@xylabs/ts-scripts-pnpm": "~7.7.5",
|
|
42
|
+
"@xylabs/tsconfig": "~7.7.5",
|
|
43
43
|
"acorn": "^8.16.0",
|
|
44
44
|
"axios": "^1.14.0",
|
|
45
45
|
"esbuild": "^0.28.0",
|