@twin.org/web 0.0.2-next.14 → 0.0.2-next.15
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
CHANGED
|
@@ -741,18 +741,18 @@ class HeaderHelper {
|
|
|
741
741
|
}
|
|
742
742
|
return `Bearer ${token.trim()}`;
|
|
743
743
|
}
|
|
744
|
-
return
|
|
744
|
+
return "";
|
|
745
745
|
}
|
|
746
746
|
/**
|
|
747
747
|
* Extract the bearer token from a header.
|
|
748
748
|
* @param header The header value to extract the token from.
|
|
749
749
|
* @returns The extracted token if it exists.
|
|
750
750
|
*/
|
|
751
|
-
static
|
|
751
|
+
static extractBearer(header) {
|
|
752
752
|
if (core.Is.stringValue(header) && header.startsWith("Bearer ")) {
|
|
753
753
|
return header.slice(7, header.length).trim();
|
|
754
754
|
}
|
|
755
|
-
return
|
|
755
|
+
return "";
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
|
package/dist/esm/index.mjs
CHANGED
|
@@ -739,18 +739,18 @@ class HeaderHelper {
|
|
|
739
739
|
}
|
|
740
740
|
return `Bearer ${token.trim()}`;
|
|
741
741
|
}
|
|
742
|
-
return
|
|
742
|
+
return "";
|
|
743
743
|
}
|
|
744
744
|
/**
|
|
745
745
|
* Extract the bearer token from a header.
|
|
746
746
|
* @param header The header value to extract the token from.
|
|
747
747
|
* @returns The extracted token if it exists.
|
|
748
748
|
*/
|
|
749
|
-
static
|
|
749
|
+
static extractBearer(header) {
|
|
750
750
|
if (Is.stringValue(header) && header.startsWith("Bearer ")) {
|
|
751
751
|
return header.slice(7, header.length).trim();
|
|
752
752
|
}
|
|
753
|
-
return
|
|
753
|
+
return "";
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
|
|
@@ -7,11 +7,11 @@ export declare class HeaderHelper {
|
|
|
7
7
|
* @param token The token to create the header for.
|
|
8
8
|
* @returns The bearer token header.
|
|
9
9
|
*/
|
|
10
|
-
static createBearer(token:
|
|
10
|
+
static createBearer(token: unknown): string;
|
|
11
11
|
/**
|
|
12
12
|
* Extract the bearer token from a header.
|
|
13
13
|
* @param header The header value to extract the token from.
|
|
14
14
|
* @returns The extracted token if it exists.
|
|
15
15
|
*/
|
|
16
|
-
static
|
|
16
|
+
static extractBearer(header: unknown): string;
|
|
17
17
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @twin.org/web - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.15](https://github.com/twinfoundation/framework/compare/web-v0.0.2-next.14...web-v0.0.2-next.15) (2025-09-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* improve bearer creation and extraction ([29a347a](https://github.com/twinfoundation/framework/commit/29a347a760cb3bc5eb819112e84f1ac99430e72b))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/core bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
16
|
+
* @twin.org/crypto bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
17
|
+
* @twin.org/nameof bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
18
|
+
* devDependencies
|
|
19
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
20
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
21
|
+
|
|
3
22
|
## [0.0.2-next.14](https://github.com/twinfoundation/framework/compare/web-v0.0.2-next.13...web-v0.0.2-next.14) (2025-09-22)
|
|
4
23
|
|
|
5
24
|
|
|
@@ -16,7 +16,7 @@ Class to helper with header operations.
|
|
|
16
16
|
|
|
17
17
|
### createBearer()
|
|
18
18
|
|
|
19
|
-
> `static` **createBearer**(`token`): `
|
|
19
|
+
> `static` **createBearer**(`token`): `string`
|
|
20
20
|
|
|
21
21
|
Create a bearer token header.
|
|
22
22
|
|
|
@@ -24,21 +24,21 @@ Create a bearer token header.
|
|
|
24
24
|
|
|
25
25
|
##### token
|
|
26
26
|
|
|
27
|
-
`
|
|
27
|
+
`unknown`
|
|
28
28
|
|
|
29
29
|
The token to create the header for.
|
|
30
30
|
|
|
31
31
|
#### Returns
|
|
32
32
|
|
|
33
|
-
`
|
|
33
|
+
`string`
|
|
34
34
|
|
|
35
35
|
The bearer token header.
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
###
|
|
39
|
+
### extractBearer()
|
|
40
40
|
|
|
41
|
-
> `static` **
|
|
41
|
+
> `static` **extractBearer**(`header`): `string`
|
|
42
42
|
|
|
43
43
|
Extract the bearer token from a header.
|
|
44
44
|
|
|
@@ -52,6 +52,6 @@ The header value to extract the token from.
|
|
|
52
52
|
|
|
53
53
|
#### Returns
|
|
54
54
|
|
|
55
|
-
`
|
|
55
|
+
`string`
|
|
56
56
|
|
|
57
57
|
The extracted token if it exists.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/web",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.15",
|
|
4
4
|
"description": "Contains classes for use with web operations",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/core": "0.0.2-next.
|
|
18
|
-
"@twin.org/crypto": "0.0.2-next.
|
|
19
|
-
"@twin.org/nameof": "0.0.2-next.
|
|
17
|
+
"@twin.org/core": "0.0.2-next.15",
|
|
18
|
+
"@twin.org/crypto": "0.0.2-next.15",
|
|
19
|
+
"@twin.org/nameof": "0.0.2-next.15",
|
|
20
20
|
"jose": "6.1.0"
|
|
21
21
|
},
|
|
22
22
|
"main": "./dist/cjs/index.cjs",
|