@astratra/native 1.0.0 → 1.1.1
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/LICENSE +1 -1
- package/package.json +6 -6
- package/src/api.js +4 -1
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astratra/native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Mobile plumbing without the mobile runtime: secure token session with an injected keystore, a biometric gate, native push registration and foreground watching, a checkout round-trip that survives a missing native module, network state that only calls a missing interface offline, over-the-air updates applied when nobody is looking, a bounded on-disk media cache, and picture sources that send the token to the app's own origin only, with originals kept as files. Adapters injected, so it tests in plain Node.",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=22"
|
|
7
7
|
},
|
|
8
8
|
"main": "src/index.js",
|
|
9
9
|
"types": "src/index.d.ts",
|
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
"files": [
|
|
12
12
|
"src"
|
|
13
13
|
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"test": "jest"
|
|
16
|
-
},
|
|
17
14
|
"jest": {
|
|
18
15
|
"testMatch": [
|
|
19
16
|
"**/__tests__/**/*.test.js"
|
|
@@ -43,5 +40,8 @@
|
|
|
43
40
|
},
|
|
44
41
|
"dependencies": {
|
|
45
42
|
"@astratra/client": "^1.0.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"test": "jest"
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
package/src/api.js
CHANGED
|
@@ -111,7 +111,10 @@ function createApiClient(options = {}) {
|
|
|
111
111
|
|
|
112
112
|
async function send(path, init, accept) {
|
|
113
113
|
const headers = await headersFor(init || {}, accept);
|
|
114
|
-
|
|
114
|
+
/* Le chemin commence toujours par « / » : collé tel quel à une adresse de base sans chemin, « @hôte/… »,
|
|
115
|
+
« .hôte/… » ou des chiffres changeraient le serveur visé, et le jeton partirait avec. */
|
|
116
|
+
const route = String(path ?? '');
|
|
117
|
+
return doFetch(`${baseUrl}${route.startsWith('/') ? route : `/${route}`}`, { ...init, headers });
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
/** JSON call: unwraps `data`, throws ApiError on anything but 2xx. */
|