@molecule/app-http 1.1.5 → 1.1.6

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/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-10-17T19:12:43.116Z
6
+ Generated: 2026-10-18T09:07:54.160Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-http
@@ -696,6 +696,11 @@ that fetches viewer-dependent data on mount (a profile's `following` flag, a fee
696
696
  bond registers that wait with `setAuthGate`; apps that bond auth through
697
697
  `@molecule/app-bonds-default-react` get it without doing anything. An app with its own session
698
698
  module registers its own: `setAuthGate(() => session.whenRestored())`.
699
+ Waiting for the restore does NOT attach the token: a client created beside the auth bond needs
700
+ `createDefaultHttpClientWithAuthBearer({ baseURL, getToken: () => authClient.getAccessToken(),
701
+ authScheme })` from `@molecule/app-bonds-default-react` (or an auth client built with
702
+ `createDefaultAuthClientWithHttpSync`, which mirrors the token into the bonded client), because
703
+ `setAuthGate` alone sends no `Authorization` header.
699
704
 
700
705
  **A request the gate itself depends on must opt out of it: pass `skipAuthGate: true`.** A gate
701
706
  that waits for a session restore whose own request goes through this client waits on itself —
@@ -15,6 +15,13 @@
15
15
  * `@molecule/app-bonds-default-react`'s auth helpers register the gate for
16
16
  * apps that bond auth, so an app does not have to get it right itself.
17
17
  *
18
+ * Waiting for the restore does NOT attach its token: a separately created HTTP
19
+ * client needs `createDefaultHttpClientWithAuthBearer({ baseURL,
20
+ * getToken: () => authClient.getAccessToken(), authScheme })` from
21
+ * `@molecule/app-bonds-default-react` (or the auth client built with
22
+ * `createDefaultAuthClientWithHttpSync`, which mirrors the token into the
23
+ * bonded client) plus `setAuthGate(() => authClient.whenRestored())`.
24
+ *
18
25
  * The gate is module-level, not per client, on purpose: the client an app ends
19
26
  * up using is often created AFTER the auth bond ran (`setupAuthDefault()` then
20
27
  * `setupHttpDefault()`), and a gate installed on the throwaway client the auth
@@ -1 +1 @@
1
- {"version":3,"file":"auth-gate.d.ts","sourceRoot":"","sources":["../src/auth-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA6CjD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,KAAG,IAGhE,CAAA;AA6BD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,GAAU,UAAU,eAAe,KAAG,OAAO,CAAC,IAAI,CAuC3E,CAAA"}
1
+ {"version":3,"file":"auth-gate.d.ts","sourceRoot":"","sources":["../src/auth-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA6CjD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,KAAG,IAGhE,CAAA;AA6BD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,GAAU,UAAU,eAAe,KAAG,OAAO,CAAC,IAAI,CAuC3E,CAAA"}
package/dist/auth-gate.js CHANGED
@@ -15,6 +15,13 @@
15
15
  * `@molecule/app-bonds-default-react`'s auth helpers register the gate for
16
16
  * apps that bond auth, so an app does not have to get it right itself.
17
17
  *
18
+ * Waiting for the restore does NOT attach its token: a separately created HTTP
19
+ * client needs `createDefaultHttpClientWithAuthBearer({ baseURL,
20
+ * getToken: () => authClient.getAccessToken(), authScheme })` from
21
+ * `@molecule/app-bonds-default-react` (or the auth client built with
22
+ * `createDefaultAuthClientWithHttpSync`, which mirrors the token into the
23
+ * bonded client) plus `setAuthGate(() => authClient.whenRestored())`.
24
+ *
18
25
  * The gate is module-level, not per client, on purpose: the client an app ends
19
26
  * up using is often created AFTER the auth bond ran (`setupAuthDefault()` then
20
27
  * `setupHttpDefault()`), and a gate installed on the throwaway client the auth
@@ -1 +1 @@
1
- {"version":3,"file":"auth-gate.js","sourceRoot":"","sources":["../src/auth-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAIhD,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAA;AAEhC,iFAAiF;AACjF,IAAI,IAAI,GAAiC,IAAI,CAAA;AAE7C;;;GAGG;AACH,MAAM,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAA;AAE9C;;;;;;;GAOG;AACH,IAAI,aAAa,GAAiC,IAAI,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,eAAe,GAAG,KAAK,CAAA;AAE7B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAkC,EAAQ,EAAE;IACtE,IAAI,GAAG,IAAI,CAAA;IACX,aAAa,GAAG,IAAI,CAAA;AACtB,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,eAAe,GAAG,CAAC,OAAyB,EAAU,EAAE,CAC5D,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,GAAG;IAC7B,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,IAAI,KAAK,IAAI,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;IAC5D,CAA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,IAAI,CAAC,oEAAoE,EAAE;oBAChF,KAAK;iBACN,CAAC,CAAA;YACJ,CAAC,CAAC;YACF,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;gBAC5B,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;oBACtB,QAAQ,GAAG,IAAI,CAAA;oBACf,mFAAmF;oBACnF,iBAAiB,CAAC,OAAO,CAAC,CAAA;oBAC1B,OAAO,EAAE,CAAA;gBACX,CAAC,EAAE,eAAe,CAAC,CAAA;YACrB,CAAC,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,KAAK;YAAE,YAAY,CAAC,KAAK,CAAC,CAAA;QAC9B,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC5B,CAAC;IAED,yFAAyF;IACzF,8EAA8E;IAC9E,IAAI,CAAC,QAAQ,IAAI,aAAa,KAAK,OAAO;QAAE,aAAa,GAAG,IAAI,CAAA;AAClE,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -72,6 +72,11 @@
72
72
  * bond registers that wait with `setAuthGate`; apps that bond auth through
73
73
  * `@molecule/app-bonds-default-react` get it without doing anything. An app with its own session
74
74
  * module registers its own: `setAuthGate(() => session.whenRestored())`.
75
+ * Waiting for the restore does NOT attach the token: a client created beside the auth bond needs
76
+ * `createDefaultHttpClientWithAuthBearer({ baseURL, getToken: () => authClient.getAccessToken(),
77
+ * authScheme })` from `@molecule/app-bonds-default-react` (or an auth client built with
78
+ * `createDefaultAuthClientWithHttpSync`, which mirrors the token into the bonded client), because
79
+ * `setAuthGate` alone sends no `Authorization` header.
75
80
  *
76
81
  * **A request the gate itself depends on must opt out of it: pass `skipAuthGate: true`.** A gate
77
82
  * that waits for a session restore whose own request goes through this client waits on itself —
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -72,6 +72,11 @@
72
72
  * bond registers that wait with `setAuthGate`; apps that bond auth through
73
73
  * `@molecule/app-bonds-default-react` get it without doing anything. An app with its own session
74
74
  * module registers its own: `setAuthGate(() => session.whenRestored())`.
75
+ * Waiting for the restore does NOT attach the token: a client created beside the auth bond needs
76
+ * `createDefaultHttpClientWithAuthBearer({ baseURL, getToken: () => authClient.getAccessToken(),
77
+ * authScheme })` from `@molecule/app-bonds-default-react` (or an auth client built with
78
+ * `createDefaultAuthClientWithHttpSync`, which mirrors the token into the bonded client), because
79
+ * `setAuthGate` alone sends no `Authorization` header.
75
80
  *
76
81
  * **A request the gate itself depends on must opt out of it: pass `skipAuthGate: true`.** A gate
77
82
  * that waits for a session restore whose own request goes through this client waits on itself —
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-http",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "Client HTTP interface for molecule.dev",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -33,7 +33,7 @@
33
33
  "@molecule/app-logger": "^1.0.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@molecule/app-bond": "1.0.2",
36
+ "@molecule/app-bond": "1.0.3",
37
37
  "@molecule/app-i18n": "1.0.3",
38
38
  "@molecule/app-logger": "1.0.2",
39
39
  "@types/node": "26.1.2",