File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -25,4 +25,3 @@ export const DeviceShadow = Type.Object({
25
25
} )
26
26
27
27
export type DeviceShadowType = Static < typeof DeviceShadow >
28
- ; ``
Original file line number Diff line number Diff line change @@ -3,17 +3,12 @@ import { slashless } from './slashless.js'
3
3
import { ValidationError , validatedFetch } from './validatedFetch.js'
4
4
import { DeviceShadow } from './DeviceShadow.js'
5
5
6
- const Device = Type . Object ( {
7
- id : Type . String ( ) ,
8
- state : Type . Optional ( DeviceShadow ) ,
9
- } )
10
-
11
6
const Page = < T extends TSchema > ( Item : T ) =>
12
7
Type . Object ( {
13
8
total : Type . Integer ( ) ,
14
9
items : Type . Array ( Item ) ,
15
10
} )
16
- const Devices = Page ( Device )
11
+ const Devices = Page ( DeviceShadow )
17
12
18
13
/**
19
14
* @link https://api.nrfcloud.com/v1/#tag/IP-Devices/operation/ProvisionDevices
@@ -46,7 +41,7 @@ export const devices = (
46
41
get : (
47
42
id : string ,
48
43
) => Promise <
49
- { error : Error | ValidationError } | { result : Static < typeof Device > }
44
+ { error : Error | ValidationError } | { result : Static < typeof DeviceShadow > }
50
45
>
51
46
updateState : (
52
47
id : string ,
@@ -87,7 +82,7 @@ export const devices = (
87
82
Devices ,
88
83
) ,
89
84
get : async ( id ) =>
90
- vf ( { resource : `devices/${ encodeURIComponent ( id ) } ` } , Device ) ,
85
+ vf ( { resource : `devices/${ encodeURIComponent ( id ) } ` } , DeviceShadow ) ,
91
86
updateState : async ( id , state ) =>
92
87
fetch (
93
88
`${ slashless ( endpoint ) } /v1/devices/${ encodeURIComponent ( id ) } /state` ,
You can’t perform that action at this time.
0 commit comments