@twin.org/web 0.0.1-next.1 → 0.0.1-next.11

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,35 +39,35 @@ const HeaderTypes = {
39
39
  /**
40
40
  * Content Type.
41
41
  */
42
- ContentType: "Content-Type",
42
+ ContentType: "content-type",
43
43
  /**
44
44
  * Content Length.
45
45
  */
46
- ContentLength: "Content-Length",
46
+ ContentLength: "content-length",
47
47
  /**
48
48
  * Content Disposition.
49
49
  */
50
- ContentDisposition: "Content-Disposition",
50
+ ContentDisposition: "content-disposition",
51
51
  /**
52
52
  * Accept.
53
53
  */
54
- Accept: "Accept",
54
+ Accept: "accept",
55
55
  /**
56
56
  * Authorization.
57
57
  */
58
- Authorization: "Authorization",
58
+ Authorization: "authorization",
59
59
  /**
60
60
  * Cookie.
61
61
  */
62
- Cookie: "Cookie",
62
+ Cookie: "cookie",
63
63
  /**
64
64
  * Set Cookie.
65
65
  */
66
- SetCookie: "Set-Cookie",
66
+ SetCookie: "set-cookie",
67
67
  /**
68
68
  * Location
69
69
  */
70
- Location: "Location"
70
+ Location: "location"
71
71
  };
72
72
 
73
73
  // Copyright 2024 IOTA Stiftung.
@@ -389,6 +389,10 @@ const MimeTypes = {
389
389
  * JSON-LD - application/ld+json
390
390
  */
391
391
  JsonLd: "application/ld+json",
392
+ /**
393
+ * JWT - application/jwt
394
+ */
395
+ Jwt: "application/jwt",
392
396
  /**
393
397
  * XML - application/xml
394
398
  */
@@ -994,12 +998,13 @@ class MimeTypeHelper {
994
998
  [MimeTypes.Javascript]: "js",
995
999
  [MimeTypes.Json]: "json",
996
1000
  [MimeTypes.JsonLd]: "jsonld",
1001
+ [MimeTypes.Jwt]: "jwt",
997
1002
  [MimeTypes.Xml]: "xml",
998
1003
  [MimeTypes.OctetStream]: "bin",
999
1004
  [MimeTypes.Gzip]: "gzip",
1000
1005
  [MimeTypes.Bzip2]: "bz2",
1001
1006
  [MimeTypes.Zip]: "zip",
1002
- [MimeTypes.Pdf]: "pfd",
1007
+ [MimeTypes.Pdf]: "pdf",
1003
1008
  [MimeTypes.Gif]: "gif",
1004
1009
  [MimeTypes.Bmp]: "bmp",
1005
1010
  [MimeTypes.Jpeg]: "jpeg",
@@ -37,35 +37,35 @@ const HeaderTypes = {
37
37
  /**
38
38
  * Content Type.
39
39
  */
40
- ContentType: "Content-Type",
40
+ ContentType: "content-type",
41
41
  /**
42
42
  * Content Length.
43
43
  */
44
- ContentLength: "Content-Length",
44
+ ContentLength: "content-length",
45
45
  /**
46
46
  * Content Disposition.
47
47
  */
48
- ContentDisposition: "Content-Disposition",
48
+ ContentDisposition: "content-disposition",
49
49
  /**
50
50
  * Accept.
51
51
  */
52
- Accept: "Accept",
52
+ Accept: "accept",
53
53
  /**
54
54
  * Authorization.
55
55
  */
56
- Authorization: "Authorization",
56
+ Authorization: "authorization",
57
57
  /**
58
58
  * Cookie.
59
59
  */
60
- Cookie: "Cookie",
60
+ Cookie: "cookie",
61
61
  /**
62
62
  * Set Cookie.
63
63
  */
64
- SetCookie: "Set-Cookie",
64
+ SetCookie: "set-cookie",
65
65
  /**
66
66
  * Location
67
67
  */
68
- Location: "Location"
68
+ Location: "location"
69
69
  };
70
70
 
71
71
  // Copyright 2024 IOTA Stiftung.
@@ -387,6 +387,10 @@ const MimeTypes = {
387
387
  * JSON-LD - application/ld+json
388
388
  */
389
389
  JsonLd: "application/ld+json",
390
+ /**
391
+ * JWT - application/jwt
392
+ */
393
+ Jwt: "application/jwt",
390
394
  /**
391
395
  * XML - application/xml
392
396
  */
@@ -992,12 +996,13 @@ class MimeTypeHelper {
992
996
  [MimeTypes.Javascript]: "js",
993
997
  [MimeTypes.Json]: "json",
994
998
  [MimeTypes.JsonLd]: "jsonld",
999
+ [MimeTypes.Jwt]: "jwt",
995
1000
  [MimeTypes.Xml]: "xml",
996
1001
  [MimeTypes.OctetStream]: "bin",
997
1002
  [MimeTypes.Gzip]: "gzip",
998
1003
  [MimeTypes.Bzip2]: "bz2",
999
1004
  [MimeTypes.Zip]: "zip",
1000
- [MimeTypes.Pdf]: "pfd",
1005
+ [MimeTypes.Pdf]: "pdf",
1001
1006
  [MimeTypes.Gif]: "gif",
1002
1007
  [MimeTypes.Bmp]: "bmp",
1003
1008
  [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
- ## v0.0.1
3
+ ## 0.0.1-next.11
4
4
 
5
5
  - Initial Release
@@ -46,334 +46,8 @@ The inner error if we have wrapped another error.
46
46
 
47
47
  ## Properties
48
48
 
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
49
  ### CLASS\_NAME
90
50
 
91
51
  > `readonly` `static` **CLASS\_NAME**: `string`
92
52
 
93
53
  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`
@@ -8,48 +8,48 @@ Common http header types.
8
8
 
9
9
  ### ContentType
10
10
 
11
- > `readonly` **ContentType**: `"Content-Type"` = `"Content-Type"`
11
+ > `readonly` **ContentType**: `"content-type"` = `"content-type"`
12
12
 
13
13
  Content Type.
14
14
 
15
15
  ### ContentLength
16
16
 
17
- > `readonly` **ContentLength**: `"Content-Length"` = `"Content-Length"`
17
+ > `readonly` **ContentLength**: `"content-length"` = `"content-length"`
18
18
 
19
19
  Content Length.
20
20
 
21
21
  ### ContentDisposition
22
22
 
23
- > `readonly` **ContentDisposition**: `"Content-Disposition"` = `"Content-Disposition"`
23
+ > `readonly` **ContentDisposition**: `"content-disposition"` = `"content-disposition"`
24
24
 
25
25
  Content Disposition.
26
26
 
27
27
  ### Accept
28
28
 
29
- > `readonly` **Accept**: `"Accept"` = `"Accept"`
29
+ > `readonly` **Accept**: `"accept"` = `"accept"`
30
30
 
31
31
  Accept.
32
32
 
33
33
  ### Authorization
34
34
 
35
- > `readonly` **Authorization**: `"Authorization"` = `"Authorization"`
35
+ > `readonly` **Authorization**: `"authorization"` = `"authorization"`
36
36
 
37
37
  Authorization.
38
38
 
39
39
  ### Cookie
40
40
 
41
- > `readonly` **Cookie**: `"Cookie"` = `"Cookie"`
41
+ > `readonly` **Cookie**: `"cookie"` = `"cookie"`
42
42
 
43
43
  Cookie.
44
44
 
45
45
  ### SetCookie
46
46
 
47
- > `readonly` **SetCookie**: `"Set-Cookie"` = `"Set-Cookie"`
47
+ > `readonly` **SetCookie**: `"set-cookie"` = `"set-cookie"`
48
48
 
49
49
  Set Cookie.
50
50
 
51
51
  ### Location
52
52
 
53
- > `readonly` **Location**: `"Location"` = `"Location"`
53
+ > `readonly` **Location**: `"location"` = `"location"`
54
54
 
55
55
  Location
@@ -36,6 +36,12 @@ JSON - application/json
36
36
 
37
37
  JSON-LD - application/ld+json
38
38
 
39
+ ### Jwt
40
+
41
+ > `readonly` **Jwt**: `"application/jwt"` = `"application/jwt"`
42
+
43
+ JWT - application/jwt
44
+
39
45
  ### Xml
40
46
 
41
47
  > `readonly` **Xml**: `"application/xml"` = `"application/xml"`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/web",
3
- "version": "0.0.1-next.1",
3
+ "version": "0.0.1-next.11",
4
4
  "description": "Contains classes for use with web operations",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,38 +13,11 @@
13
13
  "engines": {
14
14
  "node": ">=20.0.0"
15
15
  },
16
- "scripts": {
17
- "clean": "rimraf dist coverage",
18
- "build": "tspc",
19
- "test": "vitest --run --config ./vitest.config.ts --no-cache",
20
- "coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
21
- "bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
22
- "bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
23
- "bundle": "npm run bundle:esm && npm run bundle:cjs",
24
- "docs:clean": "rimraf docs/reference",
25
- "docs:generate": "typedoc",
26
- "docs": "npm run docs:clean && npm run docs:generate",
27
- "dist": "npm run clean && npm run build && npm run test && npm run bundle && npm run docs"
28
- },
29
16
  "dependencies": {
30
- "@twin.org/core": "0.0.1-next.1",
31
- "@twin.org/crypto": "0.0.1-next.1",
17
+ "@twin.org/core": "0.0.1-next.11",
18
+ "@twin.org/crypto": "0.0.1-next.11",
32
19
  "@twin.org/nameof": "next"
33
20
  },
34
- "devDependencies": {
35
- "@twin.org/nameof-transformer": "next",
36
- "@types/node": "22.5.5",
37
- "@vitest/coverage-v8": "2.1.1",
38
- "copyfiles": "2.4.1",
39
- "rimraf": "6.0.1",
40
- "rollup": "4.21.3",
41
- "rollup-plugin-typescript2": "0.36.0",
42
- "ts-patch": "3.2.1",
43
- "typedoc": "0.26.7",
44
- "typedoc-plugin-markdown": "4.2.7",
45
- "typescript": "5.6.2",
46
- "vitest": "2.1.1"
47
- },
48
21
  "main": "./dist/cjs/index.cjs",
49
22
  "module": "./dist/esm/index.mjs",
50
23
  "types": "./dist/types/index.d.ts",