@ricado/api-client 1.2.6 → 1.3.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.
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // generated by genversion
8
- var version = '1.2.6';
8
+ var version = '1.3.0';
9
9
  exports.version = version;
package/lib/Points.js CHANGED
@@ -360,6 +360,10 @@ var Points = /*#__PURE__*/function () {
360
360
  }, {
361
361
  key: "getDefinition",
362
362
  value: function getDefinition(siteId, pointId) {
363
+ if (Points.isInitialized() != true) {
364
+ return undefined;
365
+ }
366
+
363
367
  if (siteId in Points._definitions && pointId in Points._definitions[siteId]) {
364
368
  return Points._definitions[siteId][pointId];
365
369
  }
@@ -379,6 +383,10 @@ var Points = /*#__PURE__*/function () {
379
383
  }, {
380
384
  key: "getValue",
381
385
  value: function getValue(siteId, pointId) {
386
+ if (Points.isInitialized() != true) {
387
+ return undefined;
388
+ }
389
+
382
390
  if (siteId in Points._values && pointId in Points._values[siteId]) {
383
391
  return Points._values[siteId][pointId];
384
392
  }
@@ -532,7 +540,7 @@ var Points = /*#__PURE__*/function () {
532
540
  *
533
541
  * @callback Points.readPointsCallback
534
542
  * @param {number} siteId - The Site ID
535
- * @param {Object<number, Points.PointValueItem>} pointValues - An Object of Point Values
543
+ * @param {Points.PointValueItem[]} pointValues - An Object of Point Values
536
544
  * @return {void}
537
545
  */
538
546
 
package/lib/index.d.ts CHANGED
@@ -486,9 +486,7 @@ declare module '@ricado/api-client/Points' {
486
486
  /**
487
487
  * The Read Points Callback
488
488
  */
489
- export type readPointsCallback = (siteId: number, pointValues: {
490
- [x: number]: PointValueItem;
491
- }) => void;
489
+ export type readPointsCallback = (siteId: number, pointValues: PointValueItem[]) => void;
492
490
  /**
493
491
  * A Point Value Item used in a Read Points Callback
494
492
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricado/api-client",
3
- "version": "1.2.6",
3
+ "version": "1.3.0",
4
4
  "description": "RICADO Gen 4 API Client Library for NodeJS and Browsers",
5
5
  "author": {
6
6
  "name": "Ash Neilson"
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '1.2.6';
2
+ export const version = '1.3.0';
package/src/Points.js CHANGED
@@ -371,6 +371,11 @@ class Points
371
371
  */
372
372
  static getDefinition(siteId, pointId)
373
373
  {
374
+ if(Points.isInitialized() != true)
375
+ {
376
+ return undefined;
377
+ }
378
+
374
379
  if(siteId in Points._definitions && pointId in Points._definitions[siteId])
375
380
  {
376
381
  return Points._definitions[siteId][pointId];
@@ -390,6 +395,11 @@ class Points
390
395
  */
391
396
  static getValue(siteId, pointId)
392
397
  {
398
+ if(Points.isInitialized() != true)
399
+ {
400
+ return undefined;
401
+ }
402
+
393
403
  if(siteId in Points._values && pointId in Points._values[siteId])
394
404
  {
395
405
  return Points._values[siteId][pointId];
@@ -562,7 +572,7 @@ class Points
562
572
  *
563
573
  * @callback Points.readPointsCallback
564
574
  * @param {number} siteId - The Site ID
565
- * @param {Object<number, Points.PointValueItem>} pointValues - An Object of Point Values
575
+ * @param {Points.PointValueItem[]} pointValues - An Object of Point Values
566
576
  * @return {void}
567
577
  */
568
578