@mega-yfue/eufy-sdk 0.6.0-beta.27 → 0.6.0-beta.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.
@@ -135,6 +135,14 @@ export declare class EufyMega extends EventEmitter {
135
135
  * {@link disconnect}.
136
136
  */
137
137
  private readonly stationReopens;
138
+ /**
139
+ * Refuse the one misnamed option that misroutes silently. `country` is not read — the account country
140
+ * is {@link EufyMegaOptions.countryCode}, which defaults to `"US"` — so a caller that passes `country`
141
+ * has it ignored. We throw only for the case that changes routing: a non-`"US"` `country` with no
142
+ * `countryCode`, which would run on the US shard (login succeeds, but the house list comes back an empty
143
+ * placeholder). `country: "US"` already matches the default route, so it is left to pass through.
144
+ */
145
+ private static assertCountryOption;
138
146
  constructor(opts: EufyMegaOptions);
139
147
  /**
140
148
  * Builds the inbound listener that converts ThingClips DP maps to realtime capability state.
package/dist/index.js CHANGED
@@ -29572,7 +29572,7 @@ function readinessSnapshot(readiness, state = readiness.state) {
29572
29572
  wiredP2p: Object.freeze({ ...readiness.wiredP2p })
29573
29573
  });
29574
29574
  }
29575
- var EufyMega = class extends EventEmitter14 {
29575
+ var EufyMega = class _EufyMega extends EventEmitter14 {
29576
29576
  opts;
29577
29577
  mega;
29578
29578
  /**
@@ -29669,9 +29669,24 @@ var EufyMega = class extends EventEmitter14 {
29669
29669
  * {@link disconnect}.
29670
29670
  */
29671
29671
  stationReopens = /* @__PURE__ */ new Map();
29672
+ /**
29673
+ * Refuse the one misnamed option that misroutes silently. `country` is not read — the account country
29674
+ * is {@link EufyMegaOptions.countryCode}, which defaults to `"US"` — so a caller that passes `country`
29675
+ * has it ignored. We throw only for the case that changes routing: a non-`"US"` `country` with no
29676
+ * `countryCode`, which would run on the US shard (login succeeds, but the house list comes back an empty
29677
+ * placeholder). `country: "US"` already matches the default route, so it is left to pass through.
29678
+ */
29679
+ static assertCountryOption(opts) {
29680
+ if (!("country" in opts) || opts.countryCode !== void 0)
29681
+ return;
29682
+ if (String(opts.country ?? "").toUpperCase() === "US")
29683
+ return;
29684
+ throw new TypeError(`option "country" is not read; the account country is "countryCode". With "country" set and no "countryCode", this client would silently run as "US" \u2014 pass "countryCode" instead.`);
29685
+ }
29672
29686
  constructor(opts) {
29673
29687
  super();
29674
29688
  this.opts = opts;
29689
+ _EufyMega.assertCountryOption(opts);
29675
29690
  this.prewarmEvents = new Set(opts.prewarmEvents ?? []);
29676
29691
  this.prewarmTiers = new Set(opts.prewarmTiers ?? DEFAULT_PREWARM_TIERS);
29677
29692
  this.mega = new MegaHttpClient(opts);