@mengine/medeo-client 0.1.1 → 0.1.2

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/index.d.ts CHANGED
@@ -75,7 +75,14 @@ type MenginePushResponse = MenginePushUpdateResponse | MengineRejectedResponse;
75
75
  interface MengineHttpClientOptions {
76
76
  docId: string;
77
77
  httpOrigin: string;
78
- authToken?: string;
78
+ /**
79
+ * Bearer token for the `authorization` header. Accepts a static string or a
80
+ * getter evaluated per request — prefer the getter in the browser editor so
81
+ * each request carries the current login JWT (same credential the REST link
82
+ * sends), rather than a value snapshotted before login hydrates or gone stale
83
+ * after a refresh. A literal `user_dev` is the local dev/relay-test stub.
84
+ */
85
+ authToken?: string | (() => string | undefined);
79
86
  /**
80
87
  * The end-user id sent as the `medeo-user-id` header. Accepts either a static
81
88
  * string or a getter evaluated per request. Prefer the getter when the login
package/dist/index.js CHANGED
@@ -76,7 +76,8 @@ var MengineHttpClient = class {
76
76
  const headers = new Headers();
77
77
  headers.set("accept", "application/json");
78
78
  headers.set("content-type", "application/json");
79
- if (this.options.authToken != null && this.options.authToken !== "") headers.set("authorization", `Bearer ${this.options.authToken}`);
79
+ const authToken = typeof this.options.authToken === "function" ? this.options.authToken() : this.options.authToken;
80
+ if (authToken != null && authToken !== "") headers.set("authorization", `Bearer ${authToken}`);
80
81
  const userId = typeof this.options.userId === "function" ? this.options.userId() : this.options.userId;
81
82
  if (userId != null && userId !== "") headers.set("medeo-user-id", userId);
82
83
  return headers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mengine/medeo-client",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "license": "UNLICENSED",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,9 +23,9 @@
23
23
  "dependencies": {
24
24
  "loro-mirror": "^2.2.0",
25
25
  "zod": "^4.4.3",
26
- "@mengine/storage": "0.1.1",
27
- "@mengine/sync": "0.1.1",
28
- "@mengine/utils": "0.1.1"
26
+ "@mengine/storage": "0.1.2",
27
+ "@mengine/sync": "0.1.2",
28
+ "@mengine/utils": "0.1.2"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^25.9.1",