@apocaliss92/nodedreame 1.11.2 → 1.11.3

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.cjs CHANGED
@@ -86,7 +86,7 @@ module.exports = __toCommonJS(index_exports);
86
86
 
87
87
  // src/support/version.ts
88
88
  var LIBRARY_NAME = "nodedreame";
89
- var LIBRARY_VERSION = "1.11.2";
89
+ var LIBRARY_VERSION = "1.11.3";
90
90
 
91
91
  // src/transport/errors.ts
92
92
  var DreameError = class extends Error {
@@ -144,8 +144,11 @@ function buildRlcHeader(region, lang, country) {
144
144
  function randomMqttClientId() {
145
145
  return "p_" + (0, import_node_crypto.randomBytes)(8).toString("hex");
146
146
  }
147
+ var MAX_REQUEST_ID = 16777215;
148
+ var nextRequestId = Math.floor(Math.random() * 100) + 1;
147
149
  function randomRequestId() {
148
- return Math.floor(Math.random() * 2147483647) + 1;
150
+ nextRequestId = nextRequestId >= MAX_REQUEST_ID ? 1 : nextRequestId + 1;
151
+ return nextRequestId;
149
152
  }
150
153
 
151
154
  // src/auth/config.ts
@@ -344,7 +347,7 @@ var OAuthTokenResponseSchema = import_zod.z.object({
344
347
  error: import_zod.z.string().optional(),
345
348
  error_description: import_zod.z.string().optional(),
346
349
  code: import_zod.z.number().optional(),
347
- msg: import_zod.z.string().optional()
350
+ msg: import_zod.z.string().nullish()
348
351
  }).passthrough();
349
352
  var RawDeviceSchema = import_zod.z.object({
350
353
  did: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]).optional(),
@@ -359,7 +362,7 @@ var RawDeviceSchema = import_zod.z.object({
359
362
  }).passthrough();
360
363
  var DeviceListResponseSchema = import_zod.z.object({
361
364
  code: import_zod.z.number().optional(),
362
- msg: import_zod.z.string().optional(),
365
+ msg: import_zod.z.string().nullish(),
363
366
  data: import_zod.z.object({
364
367
  page: import_zod.z.object({ records: import_zod.z.array(RawDeviceSchema).optional() }).partial().optional(),
365
368
  records: import_zod.z.array(RawDeviceSchema).optional()
@@ -379,12 +382,12 @@ var CachedPropEntrySchema = import_zod.z.object({
379
382
  }).passthrough();
380
383
  var CachedPropsResponseSchema = import_zod.z.object({
381
384
  code: import_zod.z.number().optional(),
382
- msg: import_zod.z.string().optional(),
385
+ msg: import_zod.z.string().nullish(),
383
386
  data: import_zod.z.array(CachedPropEntrySchema).optional()
384
387
  }).passthrough();
385
388
  var SendCommandResponseSchema = import_zod.z.object({
386
389
  code: import_zod.z.number().optional(),
387
- msg: import_zod.z.string().optional(),
390
+ msg: import_zod.z.string().nullish(),
388
391
  data: import_zod.z.object({ result: import_zod.z.unknown().optional() }).passthrough().optional(),
389
392
  result: import_zod.z.unknown().optional()
390
393
  }).passthrough();