@mega-yfue/eufy-sdk 0.2.0-beta.18 → 0.2.0-beta.19

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.js CHANGED
@@ -1244,12 +1244,20 @@ var MegaHttpClient = class {
1244
1244
  return this.region;
1245
1245
  }
1246
1246
  /**
1247
- * The logged-in account's display name — the login email's local-part (e.g. `someone+tag` for
1248
- * `someone+tag@example.com`). This is the string the app writes into the ff09 command's acting
1249
- * "username" field (verified against a captured T8531 unlock frame). Falls back to the whole email
1250
- * if it has no `@`.
1247
+ * The name commands attribute themselves to — {@link MegaClientConfig.accountName} when the config
1248
+ * pins one (trimmed; blank counts as unset), otherwise the logged-in account's display name, which
1249
+ * is the login email's local-part (e.g. `someone+tag` for `someone+tag@example.com`) and falls back
1250
+ * to the whole email if it has no `@`.
1251
+ *
1252
+ * The local-part is the string the app writes into the ff09 command's acting "username" field
1253
+ * (verified against a captured T8531 unlock frame), so it is the faithful default. An override is a
1254
+ * different LABEL for the same account, not a different identity: the session authenticates on the
1255
+ * token and the device record's member ids, neither of which this touches.
1251
1256
  */
1252
1257
  get accountName() {
1258
+ const pinned = this.cfg.accountName?.trim();
1259
+ if (pinned)
1260
+ return pinned;
1253
1261
  const email = this.cfg.email ?? "";
1254
1262
  const at = email.indexOf("@");
1255
1263
  return at > 0 ? email.slice(0, at) : email;