Skip to content

Commit 3179c7a

Browse files
committed
fix(fota): add firmware and target description
1 parent 62ef7fb commit 3179c7a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/api/getFOTAJob.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Type, type Static } from '@sinclair/typebox'
22
import type { ValidationError } from 'ajv'
33
import { validatedFetch } from './validatedFetch.js'
4+
import { FwType } from './devices.js'
45

56
export enum FOTAJobStatus {
67
CREATED = 'CREATED',
@@ -32,6 +33,43 @@ export const FOTAJobType = Type.Object(
3233
createdAt: ts,
3334
lastUpdatedAt: Type.Optional(ts),
3435
completedAt: Type.Optional(ts),
36+
firmware: Type.Optional(
37+
Type.Object({
38+
bundleId: Type.String({
39+
minLength: 1,
40+
examples: ['APP*439ddbc7*v2.0.0'],
41+
}),
42+
fileSize: Type.Number({ minimum: 1, examples: [385068] }),
43+
firmwareType: Type.Enum(FwType, { title: 'Firmware Type' }),
44+
host: Type.String({
45+
minLength: 1,
46+
examples: ['firmware.nrfcloud.com'],
47+
}),
48+
uris: Type.Array(
49+
Type.String({
50+
minLength: 1,
51+
examples: [
52+
'bbfe6b73-a46a-43ad-94bd-8e4b4a7847ce/APP*439ddbc7*v2.0.0/hello-nrfcloud-thingy91-v2.0.0-fwupd.bin',
53+
],
54+
}),
55+
),
56+
version: Type.String({ minLength: 1, examples: ['v2.0.0'] }),
57+
}),
58+
),
59+
target: Type.Optional(
60+
Type.Object({
61+
deviceIds: Type.Array(
62+
Type.String({
63+
minLength: 1,
64+
title: 'Device ID',
65+
examples: ['oob-358299840021360'],
66+
}),
67+
),
68+
tags: Type.Array(
69+
Type.String({ minLength: 1, title: 'Tag', examples: ['nrf9160'] }),
70+
),
71+
}),
72+
),
3573
},
3674
{
3775
title: 'FOTA Job',

0 commit comments

Comments
 (0)