@hadoku/prefs-client 1.1.21 → 1.1.22

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
@@ -83,12 +83,12 @@ interface WhoamiResult {
83
83
  */
84
84
  scope: IdentityScope;
85
85
  /**
86
- * The operator vouches for this person (the edge's `isVouched`, the same
87
- * answer as the `X-Hadoku-Vouched` header): every tier above member, and a
88
- * member the operator made or vouched for. Present only as `true`; absent
89
- * means not vouched, as the header's absence does.
86
+ * The operator verifies this person (the edge's `isVerified`, the same
87
+ * answer as the `X-Hadoku-Verified` header): every tier above member, and a
88
+ * member the operator made or verified. Present only as `true`; absent
89
+ * means not verified, as the header's absence does.
90
90
  */
91
- vouched?: true;
91
+ verified?: true;
92
92
  }
93
93
  interface WhoamiOpts {
94
94
  /** Override the base URL for testing. Default: edge-router origin. */
package/dist/index.js CHANGED
@@ -116,9 +116,9 @@ function adaptWhoami(body) {
116
116
  }
117
117
  const userType = body.userType === "admin" || body.userType === "wife" || body.userType === "service" || body.userType === "friend" || body.userType === "member" || body.userType === "public" ? body.userType : "public";
118
118
  const name = typeof body.name === "string" ? body.name : null;
119
- const vouched = body.vouched === true ? { vouched: true } : {};
119
+ const verified = body.verified === true ? { verified: true } : {};
120
120
  if (typeof body.userId === "string" && body.userId) {
121
- return { userId: body.userId, userType, name, scope: "user", ...vouched };
121
+ return { userId: body.userId, userType, name, scope: "user", ...verified };
122
122
  }
123
123
  if (typeof body.sessionId === "string" && body.sessionId) {
124
124
  return {
@@ -126,10 +126,10 @@ function adaptWhoami(body) {
126
126
  userType,
127
127
  name,
128
128
  scope: "session",
129
- ...vouched
129
+ ...verified
130
130
  };
131
131
  }
132
- return { userId: UNSCOPED_ID, userType, name, scope: "none", ...vouched };
132
+ return { userId: UNSCOPED_ID, userType, name, scope: "none", ...verified };
133
133
  }
134
134
  async function fetchWhoamiRaw(url, userKey) {
135
135
  const headers = {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/prefs-client",
3
- "version": "1.1.21",
4
- "gitHead": "9ec40665c66d6d0dbeb95a2c9e1561aaccb300b8",
3
+ "version": "1.1.22",
4
+ "gitHead": "3251948ab8c8406d567973aca93780cab8fd8c03",
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",