@@ -109,6 +109,16 @@ class Cayenne extends Request {
109
109
* @param {string } applicationId
110
110
* @param {string } userId
111
111
*/
112
+ deleteThings ( applicationId , userId ) {
113
+ const path = `/things` ;
114
+ const query = this . setTenant ( applicationId , userId ) ;
115
+
116
+ return this . send ( 'DELETE' , path , { query } ) ;
117
+ }
118
+
119
+ /**
120
+ * @param {String } userId
121
+ */
112
122
destroyUser ( applicationId , userId ) {
113
123
const path = `/things` ;
114
124
const query = this . setTenant ( applicationId , userId ) ;
@@ -151,6 +161,17 @@ class Cayenne extends Request {
151
161
return this . send ( 'GET' , path , { query } ) ;
152
162
}
153
163
164
+ /**
165
+ * Delete all groups and attributes for a user
166
+ * @param {string } applicationId
167
+ * @param {string } userId The user id of the user that owns the parent device
168
+ */
169
+ deleteGroups ( applicationId , userId ) {
170
+ const path = `/things/groups` ;
171
+ const query = this . setTenant ( applicationId , userId ) ;
172
+ return this . send ( 'DELETE' , path , { query } ) ;
173
+ }
174
+
154
175
/**
155
176
* Update an attribute group. Pass null to group_id to create a new group.
156
177
* @param {string } applicationId
@@ -430,16 +451,6 @@ class Cayenne extends Request {
430
451
return this . send ( 'GET' , path , { query } ) ;
431
452
}
432
453
433
- /**
434
- * Count V2 all things data types
435
- * @param {string } id
436
- * @param {Object } query
437
- */
438
- countThingDataTypePropertiesV2 ( id , query ) {
439
- const url = `/v2/things/datatypes/${ id } /properties` ;
440
- return this . send ( 'GET' , url , { query } ) ;
441
- }
442
-
443
454
/**
444
455
* Create a V2 datatype property
445
456
* @param {String } typeId
@@ -528,6 +539,17 @@ class Cayenne extends Request {
528
539
: false
529
540
} ) ;
530
541
}
542
+
543
+ /**
544
+ * Gets a device's meta data by device type id and meta id
545
+ * @param {string } deviceTypeId
546
+ * @param {string } id
547
+ */
548
+ getOneDeviceTypeMeta ( deviceTypeId , id ) {
549
+ const path = `/things/types/${ deviceTypeId } /meta/${ id } ` ;
550
+ return this . send ( 'GET' , path ) ;
551
+ }
552
+
531
553
/**
532
554
* Gets a device's meta data by device type id
533
555
* @param {string } deviceTypeId
@@ -539,7 +561,7 @@ class Cayenne extends Request {
539
561
getDeviceTypeMetaByKey ( deviceTypeId , key , opts = { } ) {
540
562
opts = { useCache : false , cacheOnNotFound : false , ...opts } ;
541
563
542
- const path = `/things/types/${ deviceTypeId } /meta/${ key } ` ;
564
+ const path = `/things/types/${ deviceTypeId } /meta/key/ ${ key } ` ;
543
565
544
566
return this . send ( 'GET' , path , {
545
567
cache : opts . useCache
@@ -564,6 +586,15 @@ class Cayenne extends Request {
564
586
return this . send ( 'GET' , path ) ;
565
587
}
566
588
589
+ /**
590
+ * Gets a device's channel meta by device type id
591
+ * @param {string } deviceTypeId
592
+ */
593
+ getDeviceTypeChannel ( deviceTypeId , id ) {
594
+ const path = `/things/types/${ deviceTypeId } /channels/${ id } ` ;
595
+ return this . send ( 'GET' , path ) ;
596
+ }
597
+
567
598
/**
568
599
* Get a device type's uses
569
600
* @param {string } deviceTypeId
@@ -573,6 +604,15 @@ class Cayenne extends Request {
573
604
return this . send ( 'GET' , path ) ;
574
605
}
575
606
607
+ /**
608
+ * Gets a device's uses by device type id
609
+ * @param {string } deviceTypeId
610
+ */
611
+ getDeviceTypeUse ( deviceTypeId , id ) {
612
+ const path = `/things/types/${ deviceTypeId } /uses/${ id } ` ;
613
+ return this . send ( 'GET' , path ) ;
614
+ }
615
+
576
616
/**
577
617
* Creates a new device type
578
618
* @param {Object } payload
@@ -844,6 +884,19 @@ class Cayenne extends Request {
844
884
845
885
return this . send ( 'DELETE' , path , { query } ) ;
846
886
}
887
+
888
+ /**
889
+ * Deletes fuses
890
+ * @param {string } applicationId
891
+ * @param {string } userId
892
+ */
893
+ deleteFuses ( applicationId , userId ) {
894
+ const path = `/fuses` ;
895
+ const query = this . setTenant ( applicationId , userId ) ;
896
+
897
+ return this . send ( 'DELETE' , path , { query } ) ;
898
+ }
899
+
847
900
/**
848
901
* @param {string } applicationId
849
902
* @param {string } userId Owner of the fuse
0 commit comments