File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { Type, type Static } from '@sinclair/typebox'
2
2
import { JSONPayload , validatedFetch } from './validatedFetch.js'
3
3
import type { ValidationError } from 'ajv'
4
4
5
- const FOTAJobType = Type . Object (
5
+ export const CreatedFOTAJobType = Type . Object (
6
6
{
7
7
jobId : Type . String ( {
8
8
minLength : 1 ,
@@ -35,7 +35,8 @@ export const createFOTAJob =
35
35
deviceId : string
36
36
bundleId : string
37
37
} ) : Promise <
38
- { error : Error | ValidationError } | { result : Static < typeof FOTAJobType > }
38
+ | { error : Error | ValidationError }
39
+ | { result : Static < typeof CreatedFOTAJobType > }
39
40
> => {
40
41
const maybeJob = await validatedFetch (
41
42
{
@@ -48,11 +49,11 @@ export const createFOTAJob =
48
49
resource : 'fota-jobs' ,
49
50
payload : JSONPayload ( {
50
51
bundleId,
51
- autoApply : ' true' ,
52
+ autoApply : true ,
52
53
deviceIds : [ deviceId ] ,
53
54
} ) ,
54
55
} ,
55
- FOTAJobType ,
56
+ CreatedFOTAJobType ,
56
57
)
57
58
58
59
if ( 'error' in maybeJob ) return maybeJob
You can’t perform that action at this time.
0 commit comments