@hadoku/prefs-client 1.1.26 → 1.1.28

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/avatar.js CHANGED
@@ -151,8 +151,7 @@ async function fetchCharacter(opts = {}) {
151
151
  }
152
152
  }
153
153
  function onAvatarChange(onChange) {
154
- if (typeof window === "undefined") return () => {
155
- };
154
+ if (typeof window === "undefined") return () => void 0;
156
155
  const listener = (e) => {
157
156
  const settings = e.detail;
158
157
  if (settings) onChange(characterOf(settings), settings);
package/dist/index.d.ts CHANGED
@@ -75,7 +75,7 @@ declare function getDeviceId(storage?: AsyncStorage): Promise<string>;
75
75
  type IdentityScope = 'user' | 'session' | 'anon' | 'none';
76
76
  interface WhoamiResult {
77
77
  userId: string;
78
- userType: 'admin' | 'wife' | 'service' | 'friend' | 'member' | 'public';
78
+ userType: 'admin' | 'wife' | 'service' | 'friend' | 'member' | 'guest' | 'public';
79
79
  name?: string | null;
80
80
  /**
81
81
  * How `userId` was derived. Callers that PERSIST anything keyed by
package/dist/index.js CHANGED
@@ -128,7 +128,7 @@ function adaptWhoami(body) {
128
128
  if (!body || body.valid === false) {
129
129
  return { userId: ANON_USER_ID, userType: "public", scope: "anon" };
130
130
  }
131
- const userType = body.userType === "admin" || body.userType === "wife" || body.userType === "service" || body.userType === "friend" || body.userType === "member" || body.userType === "public" ? body.userType : "public";
131
+ const userType = body.userType === "admin" || body.userType === "wife" || body.userType === "service" || body.userType === "friend" || body.userType === "member" || body.userType === "guest" || body.userType === "public" ? body.userType : "public";
132
132
  const name = typeof body.name === "string" ? body.name : null;
133
133
  const verified = body.verified === true ? { verified: true } : {};
134
134
  if (typeof body.userId === "string" && body.userId) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/prefs-client",
3
- "version": "1.1.26",
4
- "gitHead": "595d6bff486fa432d50957c2d0e17ce517267e37",
3
+ "version": "1.1.28",
4
+ "gitHead": "59282e2c892f1ce99cd3455a7e848bb08368be36",
5
5
  "description": "Client SDK for the hadoku unified preferences store. Wraps /prefs/api/v1/* with localStorage caching, debounced writes, Zod-validated reads, and a usePrefs() React hook, plus match history, ratings and leaderboards for every game (./games), the one resolved avatar per user (./avatar), and the avatar cosmetics renderer (./cosmetics).",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",