@apocaliss92/nodedreame 1.3.1 → 1.4.0

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.cts CHANGED
@@ -1272,6 +1272,23 @@ declare class VacuumDevice extends BaseDevice<VacuumDeviceEvents> {
1272
1272
  refreshFromCache(): Promise<void>;
1273
1273
  /** The most-recently-decoded map, or `null` until {@link getMap} succeeds. */
1274
1274
  get lastMap(): VacuumMap | null;
1275
+ /**
1276
+ * The OSS object name of the latest map frame the robot advertised via its
1277
+ * PATH push (siid 6 piid 3), or `null` when none has been observed yet (the
1278
+ * robot has not uploaded a map since connect). This is the `filename` to pass
1279
+ * to {@link getMap} — or just call {@link fetchLatestMap}.
1280
+ */
1281
+ get mapFilename(): string | null;
1282
+ /**
1283
+ * Convenience: fetch + decode the LATEST map frame the robot advertised,
1284
+ * reading {@link mapFilename} and delegating to {@link getMap}. Returns `null`
1285
+ * when no map filename has been observed yet (vs throwing) so a consumer can
1286
+ * poll it safely; once a filename is present it behaves exactly like
1287
+ * {@link getMap} (capability-gated on `canMap`, caches {@link lastMap}, emits
1288
+ * `'map'`). The `fetcher`/`key`/`iv`/`host`/`timeoutMs`/`signal` overrides are
1289
+ * forwarded verbatim.
1290
+ */
1291
+ fetchLatestMap(opts?: Omit<VacuumGetMapInput, 'filename'>): Promise<VacuumMap | null>;
1275
1292
  /**
1276
1293
  * The current room/segment id, derived from the most-recently-decoded map's
1277
1294
  * active-segment set (`sa`). `null` when no map has been fetched or no
package/dist/index.d.ts CHANGED
@@ -1272,6 +1272,23 @@ declare class VacuumDevice extends BaseDevice<VacuumDeviceEvents> {
1272
1272
  refreshFromCache(): Promise<void>;
1273
1273
  /** The most-recently-decoded map, or `null` until {@link getMap} succeeds. */
1274
1274
  get lastMap(): VacuumMap | null;
1275
+ /**
1276
+ * The OSS object name of the latest map frame the robot advertised via its
1277
+ * PATH push (siid 6 piid 3), or `null` when none has been observed yet (the
1278
+ * robot has not uploaded a map since connect). This is the `filename` to pass
1279
+ * to {@link getMap} — or just call {@link fetchLatestMap}.
1280
+ */
1281
+ get mapFilename(): string | null;
1282
+ /**
1283
+ * Convenience: fetch + decode the LATEST map frame the robot advertised,
1284
+ * reading {@link mapFilename} and delegating to {@link getMap}. Returns `null`
1285
+ * when no map filename has been observed yet (vs throwing) so a consumer can
1286
+ * poll it safely; once a filename is present it behaves exactly like
1287
+ * {@link getMap} (capability-gated on `canMap`, caches {@link lastMap}, emits
1288
+ * `'map'`). The `fetcher`/`key`/`iv`/`host`/`timeoutMs`/`signal` overrides are
1289
+ * forwarded verbatim.
1290
+ */
1291
+ fetchLatestMap(opts?: Omit<VacuumGetMapInput, 'filename'>): Promise<VacuumMap | null>;
1275
1292
  /**
1276
1293
  * The current room/segment id, derived from the most-recently-decoded map's
1277
1294
  * active-segment set (`sa`). `null` when no map has been fetched or no
package/dist/index.js CHANGED
@@ -1152,7 +1152,14 @@ var VACUUM_PROP = {
1152
1152
  /** VERIFIED r2532a 2026-05-03 — task progress percentage 0..100. */
1153
1153
  TASK_PROGRESS_PCT: { siid: 4, piid: 63 },
1154
1154
  /** VERIFIED r2532a — mop-drying progress (minutes ticking during MopDrying). */
1155
- DRYING_PROGRESS: { siid: 4, piid: 64 }
1155
+ DRYING_PROGRESS: { siid: 4, piid: 64 },
1156
+ /**
1157
+ * Map "PATH" push — the OSS object name of the latest map frame the robot
1158
+ * uploaded (the value passed to {@link VacuumDevice.getMap}). Arrives via the
1159
+ * MQTT push during/after cleaning; NOT in `DEFAULT_PROPS` because it is not
1160
+ * polled (it is pushed). Read it through {@link VacuumDevice.mapFilename}.
1161
+ */
1162
+ MAP_PATH: { siid: 6, piid: 3 }
1156
1163
  };
1157
1164
  var VACUUM_ACTION = {
1158
1165
  /** ASSUMED Tasshack — start cleaning. */
@@ -2808,6 +2815,30 @@ var VacuumDevice = class _VacuumDevice extends BaseDevice {
2808
2815
  get lastMap() {
2809
2816
  return this.#lastMap;
2810
2817
  }
2818
+ /**
2819
+ * The OSS object name of the latest map frame the robot advertised via its
2820
+ * PATH push (siid 6 piid 3), or `null` when none has been observed yet (the
2821
+ * robot has not uploaded a map since connect). This is the `filename` to pass
2822
+ * to {@link getMap} — or just call {@link fetchLatestMap}.
2823
+ */
2824
+ get mapFilename() {
2825
+ const v = this.getProperty(VACUUM_PROP.MAP_PATH.siid, VACUUM_PROP.MAP_PATH.piid)?.value;
2826
+ return typeof v === "string" && v.length > 0 ? v : null;
2827
+ }
2828
+ /**
2829
+ * Convenience: fetch + decode the LATEST map frame the robot advertised,
2830
+ * reading {@link mapFilename} and delegating to {@link getMap}. Returns `null`
2831
+ * when no map filename has been observed yet (vs throwing) so a consumer can
2832
+ * poll it safely; once a filename is present it behaves exactly like
2833
+ * {@link getMap} (capability-gated on `canMap`, caches {@link lastMap}, emits
2834
+ * `'map'`). The `fetcher`/`key`/`iv`/`host`/`timeoutMs`/`signal` overrides are
2835
+ * forwarded verbatim.
2836
+ */
2837
+ async fetchLatestMap(opts = {}) {
2838
+ const filename = this.mapFilename;
2839
+ if (filename === null) return null;
2840
+ return this.getMap({ filename, ...opts });
2841
+ }
2811
2842
  /**
2812
2843
  * The current room/segment id, derived from the most-recently-decoded map's
2813
2844
  * active-segment set (`sa`). `null` when no map has been fetched or no