@twin.org/web 0.0.1-next.3 → 0.0.1-next.30
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/dist/cjs/index.cjs +9 -262
- package/dist/esm/index.mjs +9 -262
- package/dist/types/models/headerTypes.d.ts +8 -8
- package/dist/types/models/mimeTypes.d.ts +4 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/FetchError.md +13 -331
- package/docs/reference/classes/FetchHelper.md +51 -17
- package/docs/reference/classes/Jwt.md +75 -73
- package/docs/reference/classes/MimeTypeHelper.md +6 -2
- package/docs/reference/interfaces/IHttpHeaders.md +1 -1
- package/docs/reference/interfaces/IJwk.md +1 -1
- package/docs/reference/interfaces/IJwtHeader.md +1 -1
- package/docs/reference/interfaces/IJwtPayload.md +1 -1
- package/docs/reference/variables/HeaderTypes.md +8 -8
- package/docs/reference/variables/MimeTypes.md +6 -0
- package/package.json +5 -32
|
@@ -16,23 +16,31 @@ Create a new instance of FetchError.
|
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### source
|
|
20
|
+
|
|
21
|
+
`string`
|
|
20
22
|
|
|
21
23
|
The source of the error.
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
##### message
|
|
26
|
+
|
|
27
|
+
`string`
|
|
24
28
|
|
|
25
29
|
The message as a code.
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
##### httpStatus
|
|
32
|
+
|
|
33
|
+
[`HttpStatusCode`](../type-aliases/HttpStatusCode.md)
|
|
28
34
|
|
|
29
35
|
The http status code.
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
##### properties?
|
|
32
38
|
|
|
33
39
|
Any additional information for the error.
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
##### inner?
|
|
42
|
+
|
|
43
|
+
`unknown`
|
|
36
44
|
|
|
37
45
|
The inner error if we have wrapped another error.
|
|
38
46
|
|
|
@@ -46,334 +54,8 @@ The inner error if we have wrapped another error.
|
|
|
46
54
|
|
|
47
55
|
## Properties
|
|
48
56
|
|
|
49
|
-
### source?
|
|
50
|
-
|
|
51
|
-
> `optional` **source**: `string`
|
|
52
|
-
|
|
53
|
-
The source of the error.
|
|
54
|
-
|
|
55
|
-
#### Inherited from
|
|
56
|
-
|
|
57
|
-
`BaseError.source`
|
|
58
|
-
|
|
59
|
-
***
|
|
60
|
-
|
|
61
|
-
### properties?
|
|
62
|
-
|
|
63
|
-
> `optional` **properties**: `object`
|
|
64
|
-
|
|
65
|
-
Any additional information for the error.
|
|
66
|
-
|
|
67
|
-
#### Index Signature
|
|
68
|
-
|
|
69
|
-
\[`id`: `string`\]: `unknown`
|
|
70
|
-
|
|
71
|
-
#### Inherited from
|
|
72
|
-
|
|
73
|
-
`BaseError.properties`
|
|
74
|
-
|
|
75
|
-
***
|
|
76
|
-
|
|
77
|
-
### inner?
|
|
78
|
-
|
|
79
|
-
> `optional` **inner**: `IError`
|
|
80
|
-
|
|
81
|
-
The inner error if there was one.
|
|
82
|
-
|
|
83
|
-
#### Inherited from
|
|
84
|
-
|
|
85
|
-
`BaseError.inner`
|
|
86
|
-
|
|
87
|
-
***
|
|
88
|
-
|
|
89
57
|
### CLASS\_NAME
|
|
90
58
|
|
|
91
59
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
92
60
|
|
|
93
61
|
Runtime name for the class.
|
|
94
|
-
|
|
95
|
-
## Methods
|
|
96
|
-
|
|
97
|
-
### fromError()
|
|
98
|
-
|
|
99
|
-
> `static` **fromError**(`err`): `BaseError`
|
|
100
|
-
|
|
101
|
-
Construct an error from an existing one.
|
|
102
|
-
|
|
103
|
-
#### Parameters
|
|
104
|
-
|
|
105
|
-
• **err**: `unknown`
|
|
106
|
-
|
|
107
|
-
The existing error.
|
|
108
|
-
|
|
109
|
-
#### Returns
|
|
110
|
-
|
|
111
|
-
`BaseError`
|
|
112
|
-
|
|
113
|
-
The new instance.
|
|
114
|
-
|
|
115
|
-
#### Inherited from
|
|
116
|
-
|
|
117
|
-
`BaseError.fromError`
|
|
118
|
-
|
|
119
|
-
***
|
|
120
|
-
|
|
121
|
-
### flatten()
|
|
122
|
-
|
|
123
|
-
> `static` **flatten**(`err`): `IError`[]
|
|
124
|
-
|
|
125
|
-
Flatten an error tree.
|
|
126
|
-
|
|
127
|
-
#### Parameters
|
|
128
|
-
|
|
129
|
-
• **err**: `unknown`
|
|
130
|
-
|
|
131
|
-
The starting error.
|
|
132
|
-
|
|
133
|
-
#### Returns
|
|
134
|
-
|
|
135
|
-
`IError`[]
|
|
136
|
-
|
|
137
|
-
The list of all internal errors.
|
|
138
|
-
|
|
139
|
-
#### Inherited from
|
|
140
|
-
|
|
141
|
-
`BaseError.flatten`
|
|
142
|
-
|
|
143
|
-
***
|
|
144
|
-
|
|
145
|
-
### expand()
|
|
146
|
-
|
|
147
|
-
> `static` **expand**(`errors`): `undefined` \| `IError`
|
|
148
|
-
|
|
149
|
-
Expand an error tree.
|
|
150
|
-
|
|
151
|
-
#### Parameters
|
|
152
|
-
|
|
153
|
-
• **errors**: `undefined` \| `IError`[]
|
|
154
|
-
|
|
155
|
-
The list of errors to expand.
|
|
156
|
-
|
|
157
|
-
#### Returns
|
|
158
|
-
|
|
159
|
-
`undefined` \| `IError`
|
|
160
|
-
|
|
161
|
-
The first level error.
|
|
162
|
-
|
|
163
|
-
#### Inherited from
|
|
164
|
-
|
|
165
|
-
`BaseError.expand`
|
|
166
|
-
|
|
167
|
-
***
|
|
168
|
-
|
|
169
|
-
### isErrorName()
|
|
170
|
-
|
|
171
|
-
> `static` **isErrorName**(`error`, `name`): `error is BaseError`
|
|
172
|
-
|
|
173
|
-
Test to see if the error has the specified error name.
|
|
174
|
-
|
|
175
|
-
#### Parameters
|
|
176
|
-
|
|
177
|
-
• **error**: `unknown`
|
|
178
|
-
|
|
179
|
-
The error to test.
|
|
180
|
-
|
|
181
|
-
• **name**: `string` \| `RegExp`
|
|
182
|
-
|
|
183
|
-
The name to check for.
|
|
184
|
-
|
|
185
|
-
#### Returns
|
|
186
|
-
|
|
187
|
-
`error is BaseError`
|
|
188
|
-
|
|
189
|
-
True if the error has the name.
|
|
190
|
-
|
|
191
|
-
#### Inherited from
|
|
192
|
-
|
|
193
|
-
`BaseError.isErrorName`
|
|
194
|
-
|
|
195
|
-
***
|
|
196
|
-
|
|
197
|
-
### isErrorMessage()
|
|
198
|
-
|
|
199
|
-
> `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
|
|
200
|
-
|
|
201
|
-
Test to see if the error has the specified error message.
|
|
202
|
-
|
|
203
|
-
#### Parameters
|
|
204
|
-
|
|
205
|
-
• **error**: `unknown`
|
|
206
|
-
|
|
207
|
-
The error to test.
|
|
208
|
-
|
|
209
|
-
• **message**: `string` \| `RegExp`
|
|
210
|
-
|
|
211
|
-
The message to check for.
|
|
212
|
-
|
|
213
|
-
#### Returns
|
|
214
|
-
|
|
215
|
-
`error is BaseError`
|
|
216
|
-
|
|
217
|
-
True if the error has the name.
|
|
218
|
-
|
|
219
|
-
#### Inherited from
|
|
220
|
-
|
|
221
|
-
`BaseError.isErrorMessage`
|
|
222
|
-
|
|
223
|
-
***
|
|
224
|
-
|
|
225
|
-
### isErrorCode()
|
|
226
|
-
|
|
227
|
-
> `static` **isErrorCode**(`error`, `code`): `boolean`
|
|
228
|
-
|
|
229
|
-
Test to see if the error has the specified error code.
|
|
230
|
-
|
|
231
|
-
#### Parameters
|
|
232
|
-
|
|
233
|
-
• **error**: `unknown`
|
|
234
|
-
|
|
235
|
-
The error to test.
|
|
236
|
-
|
|
237
|
-
• **code**: `string` \| `RegExp`
|
|
238
|
-
|
|
239
|
-
The code to check for.
|
|
240
|
-
|
|
241
|
-
#### Returns
|
|
242
|
-
|
|
243
|
-
`boolean`
|
|
244
|
-
|
|
245
|
-
True if the error has the code.
|
|
246
|
-
|
|
247
|
-
#### Inherited from
|
|
248
|
-
|
|
249
|
-
`BaseError.isErrorCode`
|
|
250
|
-
|
|
251
|
-
***
|
|
252
|
-
|
|
253
|
-
### someErrorName()
|
|
254
|
-
|
|
255
|
-
> `static` **someErrorName**(`error`, `name`): `error is BaseError`
|
|
256
|
-
|
|
257
|
-
Test to see if any of the errors or children have the given error name.
|
|
258
|
-
|
|
259
|
-
#### Parameters
|
|
260
|
-
|
|
261
|
-
• **error**: `unknown`
|
|
262
|
-
|
|
263
|
-
The error to test.
|
|
264
|
-
|
|
265
|
-
• **name**: `string` \| `RegExp`
|
|
266
|
-
|
|
267
|
-
The name to check for.
|
|
268
|
-
|
|
269
|
-
#### Returns
|
|
270
|
-
|
|
271
|
-
`error is BaseError`
|
|
272
|
-
|
|
273
|
-
True if the error has the name.
|
|
274
|
-
|
|
275
|
-
#### Inherited from
|
|
276
|
-
|
|
277
|
-
`BaseError.someErrorName`
|
|
278
|
-
|
|
279
|
-
***
|
|
280
|
-
|
|
281
|
-
### someErrorMessage()
|
|
282
|
-
|
|
283
|
-
> `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
|
|
284
|
-
|
|
285
|
-
Test to see if any of the errors or children have the given error message.
|
|
286
|
-
|
|
287
|
-
#### Parameters
|
|
288
|
-
|
|
289
|
-
• **error**: `unknown`
|
|
290
|
-
|
|
291
|
-
The error to test.
|
|
292
|
-
|
|
293
|
-
• **message**: `string` \| `RegExp`
|
|
294
|
-
|
|
295
|
-
The message to check for.
|
|
296
|
-
|
|
297
|
-
#### Returns
|
|
298
|
-
|
|
299
|
-
`error is BaseError`
|
|
300
|
-
|
|
301
|
-
True if the error has the name.
|
|
302
|
-
|
|
303
|
-
#### Inherited from
|
|
304
|
-
|
|
305
|
-
`BaseError.someErrorMessage`
|
|
306
|
-
|
|
307
|
-
***
|
|
308
|
-
|
|
309
|
-
### someErrorClass()
|
|
310
|
-
|
|
311
|
-
> `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
|
|
312
|
-
|
|
313
|
-
Test to see if any of the errors or children are from a specific class.
|
|
314
|
-
|
|
315
|
-
#### Parameters
|
|
316
|
-
|
|
317
|
-
• **error**: `unknown`
|
|
318
|
-
|
|
319
|
-
The error to test.
|
|
320
|
-
|
|
321
|
-
• **cls**: `string`
|
|
322
|
-
|
|
323
|
-
The class to check for.
|
|
324
|
-
|
|
325
|
-
#### Returns
|
|
326
|
-
|
|
327
|
-
`error is BaseError`
|
|
328
|
-
|
|
329
|
-
True if the error has the specific class.
|
|
330
|
-
|
|
331
|
-
#### Inherited from
|
|
332
|
-
|
|
333
|
-
`BaseError.someErrorClass`
|
|
334
|
-
|
|
335
|
-
***
|
|
336
|
-
|
|
337
|
-
### someErrorCode()
|
|
338
|
-
|
|
339
|
-
> `static` **someErrorCode**(`error`, `code`): `error is BaseError`
|
|
340
|
-
|
|
341
|
-
Test to see if any of the errors or children have the given error code.
|
|
342
|
-
|
|
343
|
-
#### Parameters
|
|
344
|
-
|
|
345
|
-
• **error**: `unknown`
|
|
346
|
-
|
|
347
|
-
The error to test.
|
|
348
|
-
|
|
349
|
-
• **code**: `string` \| `RegExp`
|
|
350
|
-
|
|
351
|
-
The code to check for.
|
|
352
|
-
|
|
353
|
-
#### Returns
|
|
354
|
-
|
|
355
|
-
`error is BaseError`
|
|
356
|
-
|
|
357
|
-
True if the error has the name.
|
|
358
|
-
|
|
359
|
-
#### Inherited from
|
|
360
|
-
|
|
361
|
-
`BaseError.someErrorCode`
|
|
362
|
-
|
|
363
|
-
***
|
|
364
|
-
|
|
365
|
-
### toJsonObject()
|
|
366
|
-
|
|
367
|
-
> **toJsonObject**(): `IError`
|
|
368
|
-
|
|
369
|
-
Serialize the error to the error model.
|
|
370
|
-
|
|
371
|
-
#### Returns
|
|
372
|
-
|
|
373
|
-
`IError`
|
|
374
|
-
|
|
375
|
-
The error model.
|
|
376
|
-
|
|
377
|
-
#### Inherited from
|
|
378
|
-
|
|
379
|
-
`BaseError.toJsonObject`
|
|
@@ -22,23 +22,33 @@ Perform a fetch request.
|
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### source
|
|
26
|
+
|
|
27
|
+
`string`
|
|
26
28
|
|
|
27
29
|
The source for the request.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
##### url
|
|
32
|
+
|
|
33
|
+
`string`
|
|
30
34
|
|
|
31
35
|
The url for the request.
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
##### method
|
|
38
|
+
|
|
39
|
+
[`HttpMethod`](../type-aliases/HttpMethod.md)
|
|
34
40
|
|
|
35
41
|
The http method.
|
|
36
42
|
|
|
37
|
-
|
|
43
|
+
##### body?
|
|
38
44
|
|
|
39
45
|
Request to send to the endpoint.
|
|
40
46
|
|
|
41
|
-
|
|
47
|
+
`string` | `Uint8Array`
|
|
48
|
+
|
|
49
|
+
##### options?
|
|
50
|
+
|
|
51
|
+
`Omit`\<[`IFetchOptions`](../interfaces/IFetchOptions.md), `"cacheTtlSeconds"`\>
|
|
42
52
|
|
|
43
53
|
Options for sending the requests.
|
|
44
54
|
|
|
@@ -64,23 +74,33 @@ Perform a request in json format.
|
|
|
64
74
|
|
|
65
75
|
#### Parameters
|
|
66
76
|
|
|
67
|
-
|
|
77
|
+
##### source
|
|
78
|
+
|
|
79
|
+
`string`
|
|
68
80
|
|
|
69
81
|
The source for the request.
|
|
70
82
|
|
|
71
|
-
|
|
83
|
+
##### url
|
|
84
|
+
|
|
85
|
+
`string`
|
|
72
86
|
|
|
73
87
|
The url for the request.
|
|
74
88
|
|
|
75
|
-
|
|
89
|
+
##### method
|
|
90
|
+
|
|
91
|
+
[`HttpMethod`](../type-aliases/HttpMethod.md)
|
|
76
92
|
|
|
77
93
|
The http method.
|
|
78
94
|
|
|
79
|
-
|
|
95
|
+
##### requestData?
|
|
96
|
+
|
|
97
|
+
`T`
|
|
80
98
|
|
|
81
99
|
Request to send to the endpoint.
|
|
82
100
|
|
|
83
|
-
|
|
101
|
+
##### options?
|
|
102
|
+
|
|
103
|
+
[`IFetchOptions`](../interfaces/IFetchOptions.md)
|
|
84
104
|
|
|
85
105
|
Options for sending the requests.
|
|
86
106
|
|
|
@@ -104,23 +124,33 @@ Perform a request for binary data.
|
|
|
104
124
|
|
|
105
125
|
#### Parameters
|
|
106
126
|
|
|
107
|
-
|
|
127
|
+
##### source
|
|
128
|
+
|
|
129
|
+
`string`
|
|
108
130
|
|
|
109
131
|
The source for the request.
|
|
110
132
|
|
|
111
|
-
|
|
133
|
+
##### url
|
|
134
|
+
|
|
135
|
+
`string`
|
|
112
136
|
|
|
113
137
|
The url for the request.
|
|
114
138
|
|
|
115
|
-
|
|
139
|
+
##### method
|
|
116
140
|
|
|
117
141
|
The http method.
|
|
118
142
|
|
|
119
|
-
|
|
143
|
+
`"GET"` | `"POST"`
|
|
144
|
+
|
|
145
|
+
##### requestData?
|
|
146
|
+
|
|
147
|
+
`Uint8Array`
|
|
120
148
|
|
|
121
149
|
Request to send to the endpoint.
|
|
122
150
|
|
|
123
|
-
|
|
151
|
+
##### options?
|
|
152
|
+
|
|
153
|
+
[`IFetchOptions`](../interfaces/IFetchOptions.md)
|
|
124
154
|
|
|
125
155
|
Options for sending the requests.
|
|
126
156
|
|
|
@@ -156,7 +186,9 @@ Get a cache entry.
|
|
|
156
186
|
|
|
157
187
|
#### Parameters
|
|
158
188
|
|
|
159
|
-
|
|
189
|
+
##### url
|
|
190
|
+
|
|
191
|
+
`string`
|
|
160
192
|
|
|
161
193
|
The url for the request.
|
|
162
194
|
|
|
@@ -176,7 +208,9 @@ Remove a cache entry.
|
|
|
176
208
|
|
|
177
209
|
#### Parameters
|
|
178
210
|
|
|
179
|
-
|
|
211
|
+
##### url
|
|
212
|
+
|
|
213
|
+
`string`
|
|
180
214
|
|
|
181
215
|
The url for the request.
|
|
182
216
|
|