@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.
@@ -39,36 +39,7 @@ const HeaderTypes = {
39
39
  /**
40
40
  * Content Type.
41
41
  */
42
- ContentType: "Content-Type",
43
- /**
44
- * Content Length.
45
- */
46
- ContentLength: "Content-Length",
47
- /**
48
- * Content Disposition.
49
- */
50
- ContentDisposition: "Content-Disposition",
51
- /**
52
- * Accept.
53
- */
54
- Accept: "Accept",
55
- /**
56
- * Authorization.
57
- */
58
- Authorization: "Authorization",
59
- /**
60
- * Cookie.
61
- */
62
- Cookie: "Cookie",
63
- /**
64
- * Set Cookie.
65
- */
66
- SetCookie: "Set-Cookie",
67
- /**
68
- * Location
69
- */
70
- Location: "Location"
71
- };
42
+ ContentType: "content-type"};
72
43
 
73
44
  // Copyright 2024 IOTA Stiftung.
74
45
  // SPDX-License-Identifier: Apache-2.0.
@@ -95,255 +66,26 @@ const HttpMethod = {
95
66
  */
96
67
  // eslint-disable-next-line @typescript-eslint/naming-convention
97
68
  const HttpStatusCode = {
98
- /**
99
- * Continue status code.
100
- */
101
- continue: 100,
102
- /**
103
- * Switching Protocols status code.
104
- */
105
- switchingProtocols: 101,
106
- /**
107
- * Processing status code.
108
- */
109
- processing: 102,
110
- /**
111
- * Early Hints status code.
112
- */
113
- earlyHints: 103,
114
- /**
115
- * OK status code.
116
- */
117
- ok: 200,
118
- /**
119
- * Created status code.
120
- */
121
- created: 201,
122
- /**
123
- * Accepted status code.
124
- */
125
- accepted: 202,
126
- /**
127
- * Non-Authoritative Information status code.
128
- */
129
- nonAuthoritativeInformation: 203,
130
69
  /**
131
70
  * No Content status code.
132
71
  */
133
72
  noContent: 204,
134
- /**
135
- * Reset Content status code.
136
- */
137
- resetContent: 205,
138
- /**
139
- * Partial Content status code.
140
- */
141
- partialContent: 206,
142
- /**
143
- * Multi-Status status code.
144
- */
145
- multiStatus: 207,
146
- /**
147
- * Already Reported status code.
148
- */
149
- alreadyReported: 208,
150
- /**
151
- * IM Used status code.
152
- */
153
- imUsed: 226,
154
- /**
155
- * Multiple Choices status code.
156
- */
157
- multipleChoices: 300,
158
- /**
159
- * Moved Permanently status code.
160
- */
161
- movedPermanently: 301,
162
- /**
163
- * Found status code.
164
- */
165
- found: 302,
166
- /**
167
- * See Other status code.
168
- */
169
- seeOther: 303,
170
- /**
171
- * Not Modified status code.
172
- */
173
- notModified: 304,
174
- /**
175
- * Use Proxy status code.
176
- */
177
- useProxy: 305,
178
- /**
179
- * Temporary Redirect status code.
180
- */
181
- temporaryRedirect: 307,
182
- /**
183
- * Permanent Redirect status code.
184
- */
185
- permanentRedirect: 308,
186
73
  /**
187
74
  * Bad Request status code.
188
75
  */
189
76
  badRequest: 400,
190
- /**
191
- * Unauthorized status code.
192
- */
193
- unauthorized: 401,
194
- /**
195
- * Payment Required status code.
196
- */
197
- paymentRequired: 402,
198
- /**
199
- * Forbidden status code.
200
- */
201
- forbidden: 403,
202
- /**
203
- * Not Found status code.
204
- */
205
- notFound: 404,
206
- /**
207
- * Method Not Allowed status code.
208
- */
209
- methodNotAllowed: 405,
210
- /**
211
- * Not Acceptable status code.
212
- */
213
- notAcceptable: 406,
214
- /**
215
- * Proxy Authentication Required status code.
216
- */
217
- proxyAuthenticationRequired: 407,
218
77
  /**
219
78
  * Request Timeout status code.
220
79
  */
221
80
  requestTimeout: 408,
222
- /**
223
- * Conflict status code.
224
- */
225
- conflict: 409,
226
- /**
227
- * Gone status code.
228
- */
229
- gone: 410,
230
- /**
231
- * Length Required status code.
232
- */
233
- lengthRequired: 411,
234
- /**
235
- * Precondition Failed status code.
236
- */
237
- preconditionFailed: 412,
238
- /**
239
- * Payload Too Large status code.
240
- */
241
- payloadTooLarge: 413,
242
- /**
243
- * URI Too Long status code.
244
- */
245
- uriTooLong: 414,
246
- /**
247
- * Unsupported Media Type status code.
248
- */
249
- unsupportedMediaType: 415,
250
- /**
251
- * Range Not Satisfiable status code.
252
- */
253
- rangeNotSatisfiable: 416,
254
- /**
255
- * Expectation Failed status code.
256
- */
257
- expectationFailed: 417,
258
- /**
259
- * I'm a Teapot status code.
260
- */
261
- imATeapot: 418,
262
- /**
263
- * Misdirected Request status code.
264
- */
265
- misdirectedRequest: 421,
266
- /**
267
- * Unprocessable Entity status code.
268
- */
269
- unprocessableEntity: 422,
270
- /**
271
- * Locked status code.
272
- */
273
- locked: 423,
274
- /**
275
- * Failed Dependency status code.
276
- */
277
- failedDependency: 424,
278
- /**
279
- * Too Early status code.
280
- */
281
- tooEarly: 425,
282
- /**
283
- * Upgrade Required status code.
284
- */
285
- upgradeRequired: 426,
286
- /**
287
- * Precondition Required status code.
288
- */
289
- preconditionRequired: 428,
290
- /**
291
- * Too Many Requests status code.
292
- */
293
- tooManyRequests: 429,
294
- /**
295
- * Request Header Fields Too Large status code.
296
- */
297
- requestHeaderFieldsTooLarge: 431,
298
- /**
299
- * Unavailable For Legal Reasons status code.
300
- */
301
- unavailableForLegalReasons: 451,
302
81
  /**
303
82
  * Internal Server Error status code.
304
83
  */
305
84
  internalServerError: 500,
306
- /**
307
- * Not Implemented status code.
308
- */
309
- notImplemented: 501,
310
- /**
311
- * Bad Gateway status code.
312
- */
313
- badGateway: 502,
314
85
  /**
315
86
  * Service Unavailable status code.
316
87
  */
317
- serviceUnavailable: 503,
318
- /**
319
- * Gateway Timeout status code.
320
- */
321
- gatewayTimeout: 504,
322
- /**
323
- * HTTP Version Not Supported status code.
324
- */
325
- httpVersionNotSupported: 505,
326
- /**
327
- * Variant Also Negotiates status code.
328
- */
329
- variantAlsoNegotiates: 506,
330
- /**
331
- * Insufficient Storage status code.
332
- */
333
- insufficientStorage: 507,
334
- /**
335
- * Loop Detected status code.
336
- */
337
- loopDetected: 508,
338
- /**
339
- * Not Extended status code.
340
- */
341
- notExtended: 510,
342
- /**
343
- * Network Authentication Required status code.
344
- */
345
- networkAuthenticationRequired: 511
346
- };
88
+ serviceUnavailable: 503};
347
89
 
348
90
  // Copyright 2024 IOTA Stiftung.
349
91
  // SPDX-License-Identifier: Apache-2.0.
@@ -389,6 +131,10 @@ const MimeTypes = {
389
131
  * JSON-LD - application/ld+json
390
132
  */
391
133
  JsonLd: "application/ld+json",
134
+ /**
135
+ * JWT - application/jwt
136
+ */
137
+ Jwt: "application/jwt",
392
138
  /**
393
139
  * XML - application/xml
394
140
  */
@@ -922,7 +668,7 @@ class MimeTypeHelper {
922
668
  * @returns The mime type if detected.
923
669
  */
924
670
  static async detect(data) {
925
- if (!core.Is.uint8Array(data)) {
671
+ if (!core.Is.uint8Array(data) || data.length === 0) {
926
672
  return undefined;
927
673
  }
928
674
  // Image
@@ -994,12 +740,13 @@ class MimeTypeHelper {
994
740
  [MimeTypes.Javascript]: "js",
995
741
  [MimeTypes.Json]: "json",
996
742
  [MimeTypes.JsonLd]: "jsonld",
743
+ [MimeTypes.Jwt]: "jwt",
997
744
  [MimeTypes.Xml]: "xml",
998
745
  [MimeTypes.OctetStream]: "bin",
999
746
  [MimeTypes.Gzip]: "gzip",
1000
747
  [MimeTypes.Bzip2]: "bz2",
1001
748
  [MimeTypes.Zip]: "zip",
1002
- [MimeTypes.Pdf]: "pfd",
749
+ [MimeTypes.Pdf]: "pdf",
1003
750
  [MimeTypes.Gif]: "gif",
1004
751
  [MimeTypes.Bmp]: "bmp",
1005
752
  [MimeTypes.Jpeg]: "jpeg",
@@ -37,36 +37,7 @@ const HeaderTypes = {
37
37
  /**
38
38
  * Content Type.
39
39
  */
40
- ContentType: "Content-Type",
41
- /**
42
- * Content Length.
43
- */
44
- ContentLength: "Content-Length",
45
- /**
46
- * Content Disposition.
47
- */
48
- ContentDisposition: "Content-Disposition",
49
- /**
50
- * Accept.
51
- */
52
- Accept: "Accept",
53
- /**
54
- * Authorization.
55
- */
56
- Authorization: "Authorization",
57
- /**
58
- * Cookie.
59
- */
60
- Cookie: "Cookie",
61
- /**
62
- * Set Cookie.
63
- */
64
- SetCookie: "Set-Cookie",
65
- /**
66
- * Location
67
- */
68
- Location: "Location"
69
- };
40
+ ContentType: "content-type"};
70
41
 
71
42
  // Copyright 2024 IOTA Stiftung.
72
43
  // SPDX-License-Identifier: Apache-2.0.
@@ -93,255 +64,26 @@ const HttpMethod = {
93
64
  */
94
65
  // eslint-disable-next-line @typescript-eslint/naming-convention
95
66
  const HttpStatusCode = {
96
- /**
97
- * Continue status code.
98
- */
99
- continue: 100,
100
- /**
101
- * Switching Protocols status code.
102
- */
103
- switchingProtocols: 101,
104
- /**
105
- * Processing status code.
106
- */
107
- processing: 102,
108
- /**
109
- * Early Hints status code.
110
- */
111
- earlyHints: 103,
112
- /**
113
- * OK status code.
114
- */
115
- ok: 200,
116
- /**
117
- * Created status code.
118
- */
119
- created: 201,
120
- /**
121
- * Accepted status code.
122
- */
123
- accepted: 202,
124
- /**
125
- * Non-Authoritative Information status code.
126
- */
127
- nonAuthoritativeInformation: 203,
128
67
  /**
129
68
  * No Content status code.
130
69
  */
131
70
  noContent: 204,
132
- /**
133
- * Reset Content status code.
134
- */
135
- resetContent: 205,
136
- /**
137
- * Partial Content status code.
138
- */
139
- partialContent: 206,
140
- /**
141
- * Multi-Status status code.
142
- */
143
- multiStatus: 207,
144
- /**
145
- * Already Reported status code.
146
- */
147
- alreadyReported: 208,
148
- /**
149
- * IM Used status code.
150
- */
151
- imUsed: 226,
152
- /**
153
- * Multiple Choices status code.
154
- */
155
- multipleChoices: 300,
156
- /**
157
- * Moved Permanently status code.
158
- */
159
- movedPermanently: 301,
160
- /**
161
- * Found status code.
162
- */
163
- found: 302,
164
- /**
165
- * See Other status code.
166
- */
167
- seeOther: 303,
168
- /**
169
- * Not Modified status code.
170
- */
171
- notModified: 304,
172
- /**
173
- * Use Proxy status code.
174
- */
175
- useProxy: 305,
176
- /**
177
- * Temporary Redirect status code.
178
- */
179
- temporaryRedirect: 307,
180
- /**
181
- * Permanent Redirect status code.
182
- */
183
- permanentRedirect: 308,
184
71
  /**
185
72
  * Bad Request status code.
186
73
  */
187
74
  badRequest: 400,
188
- /**
189
- * Unauthorized status code.
190
- */
191
- unauthorized: 401,
192
- /**
193
- * Payment Required status code.
194
- */
195
- paymentRequired: 402,
196
- /**
197
- * Forbidden status code.
198
- */
199
- forbidden: 403,
200
- /**
201
- * Not Found status code.
202
- */
203
- notFound: 404,
204
- /**
205
- * Method Not Allowed status code.
206
- */
207
- methodNotAllowed: 405,
208
- /**
209
- * Not Acceptable status code.
210
- */
211
- notAcceptable: 406,
212
- /**
213
- * Proxy Authentication Required status code.
214
- */
215
- proxyAuthenticationRequired: 407,
216
75
  /**
217
76
  * Request Timeout status code.
218
77
  */
219
78
  requestTimeout: 408,
220
- /**
221
- * Conflict status code.
222
- */
223
- conflict: 409,
224
- /**
225
- * Gone status code.
226
- */
227
- gone: 410,
228
- /**
229
- * Length Required status code.
230
- */
231
- lengthRequired: 411,
232
- /**
233
- * Precondition Failed status code.
234
- */
235
- preconditionFailed: 412,
236
- /**
237
- * Payload Too Large status code.
238
- */
239
- payloadTooLarge: 413,
240
- /**
241
- * URI Too Long status code.
242
- */
243
- uriTooLong: 414,
244
- /**
245
- * Unsupported Media Type status code.
246
- */
247
- unsupportedMediaType: 415,
248
- /**
249
- * Range Not Satisfiable status code.
250
- */
251
- rangeNotSatisfiable: 416,
252
- /**
253
- * Expectation Failed status code.
254
- */
255
- expectationFailed: 417,
256
- /**
257
- * I'm a Teapot status code.
258
- */
259
- imATeapot: 418,
260
- /**
261
- * Misdirected Request status code.
262
- */
263
- misdirectedRequest: 421,
264
- /**
265
- * Unprocessable Entity status code.
266
- */
267
- unprocessableEntity: 422,
268
- /**
269
- * Locked status code.
270
- */
271
- locked: 423,
272
- /**
273
- * Failed Dependency status code.
274
- */
275
- failedDependency: 424,
276
- /**
277
- * Too Early status code.
278
- */
279
- tooEarly: 425,
280
- /**
281
- * Upgrade Required status code.
282
- */
283
- upgradeRequired: 426,
284
- /**
285
- * Precondition Required status code.
286
- */
287
- preconditionRequired: 428,
288
- /**
289
- * Too Many Requests status code.
290
- */
291
- tooManyRequests: 429,
292
- /**
293
- * Request Header Fields Too Large status code.
294
- */
295
- requestHeaderFieldsTooLarge: 431,
296
- /**
297
- * Unavailable For Legal Reasons status code.
298
- */
299
- unavailableForLegalReasons: 451,
300
79
  /**
301
80
  * Internal Server Error status code.
302
81
  */
303
82
  internalServerError: 500,
304
- /**
305
- * Not Implemented status code.
306
- */
307
- notImplemented: 501,
308
- /**
309
- * Bad Gateway status code.
310
- */
311
- badGateway: 502,
312
83
  /**
313
84
  * Service Unavailable status code.
314
85
  */
315
- serviceUnavailable: 503,
316
- /**
317
- * Gateway Timeout status code.
318
- */
319
- gatewayTimeout: 504,
320
- /**
321
- * HTTP Version Not Supported status code.
322
- */
323
- httpVersionNotSupported: 505,
324
- /**
325
- * Variant Also Negotiates status code.
326
- */
327
- variantAlsoNegotiates: 506,
328
- /**
329
- * Insufficient Storage status code.
330
- */
331
- insufficientStorage: 507,
332
- /**
333
- * Loop Detected status code.
334
- */
335
- loopDetected: 508,
336
- /**
337
- * Not Extended status code.
338
- */
339
- notExtended: 510,
340
- /**
341
- * Network Authentication Required status code.
342
- */
343
- networkAuthenticationRequired: 511
344
- };
86
+ serviceUnavailable: 503};
345
87
 
346
88
  // Copyright 2024 IOTA Stiftung.
347
89
  // SPDX-License-Identifier: Apache-2.0.
@@ -387,6 +129,10 @@ const MimeTypes = {
387
129
  * JSON-LD - application/ld+json
388
130
  */
389
131
  JsonLd: "application/ld+json",
132
+ /**
133
+ * JWT - application/jwt
134
+ */
135
+ Jwt: "application/jwt",
390
136
  /**
391
137
  * XML - application/xml
392
138
  */
@@ -920,7 +666,7 @@ class MimeTypeHelper {
920
666
  * @returns The mime type if detected.
921
667
  */
922
668
  static async detect(data) {
923
- if (!Is.uint8Array(data)) {
669
+ if (!Is.uint8Array(data) || data.length === 0) {
924
670
  return undefined;
925
671
  }
926
672
  // Image
@@ -992,12 +738,13 @@ class MimeTypeHelper {
992
738
  [MimeTypes.Javascript]: "js",
993
739
  [MimeTypes.Json]: "json",
994
740
  [MimeTypes.JsonLd]: "jsonld",
741
+ [MimeTypes.Jwt]: "jwt",
995
742
  [MimeTypes.Xml]: "xml",
996
743
  [MimeTypes.OctetStream]: "bin",
997
744
  [MimeTypes.Gzip]: "gzip",
998
745
  [MimeTypes.Bzip2]: "bz2",
999
746
  [MimeTypes.Zip]: "zip",
1000
- [MimeTypes.Pdf]: "pfd",
747
+ [MimeTypes.Pdf]: "pdf",
1001
748
  [MimeTypes.Gif]: "gif",
1002
749
  [MimeTypes.Bmp]: "bmp",
1003
750
  [MimeTypes.Jpeg]: "jpeg",
@@ -5,35 +5,35 @@ export declare const HeaderTypes: {
5
5
  /**
6
6
  * Content Type.
7
7
  */
8
- readonly ContentType: "Content-Type";
8
+ readonly ContentType: "content-type";
9
9
  /**
10
10
  * Content Length.
11
11
  */
12
- readonly ContentLength: "Content-Length";
12
+ readonly ContentLength: "content-length";
13
13
  /**
14
14
  * Content Disposition.
15
15
  */
16
- readonly ContentDisposition: "Content-Disposition";
16
+ readonly ContentDisposition: "content-disposition";
17
17
  /**
18
18
  * Accept.
19
19
  */
20
- readonly Accept: "Accept";
20
+ readonly Accept: "accept";
21
21
  /**
22
22
  * Authorization.
23
23
  */
24
- readonly Authorization: "Authorization";
24
+ readonly Authorization: "authorization";
25
25
  /**
26
26
  * Cookie.
27
27
  */
28
- readonly Cookie: "Cookie";
28
+ readonly Cookie: "cookie";
29
29
  /**
30
30
  * Set Cookie.
31
31
  */
32
- readonly SetCookie: "Set-Cookie";
32
+ readonly SetCookie: "set-cookie";
33
33
  /**
34
34
  * Location
35
35
  */
36
- readonly Location: "Location";
36
+ readonly Location: "location";
37
37
  };
38
38
  /**
39
39
  * Common http header types.
@@ -22,6 +22,10 @@ export declare const MimeTypes: {
22
22
  * JSON-LD - application/ld+json
23
23
  */
24
24
  readonly JsonLd: "application/ld+json";
25
+ /**
26
+ * JWT - application/jwt
27
+ */
28
+ readonly Jwt: "application/jwt";
25
29
  /**
26
30
  * XML - application/xml
27
31
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/web - Changelog
2
2
 
3
- ## 0.0.1-next.3
3
+ ## 0.0.1-next.30
4
4
 
5
5
  - Initial Release