@hello.nrfcloud.com/nrfcloud-api-helpers 5.0.1 → 5.0.3
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.
- package/dist/api/devices.js +1 -0
- package/dist/api/getFOTAJob.d.ts +15 -0
- package/dist/api/getFOTAJob.js +30 -0
- package/package.json +1 -1
package/dist/api/devices.js
CHANGED
|
@@ -32,6 +32,7 @@ export const devices = ({ endpoint, apiKey, }, fetchImplementation) => {
|
|
|
32
32
|
};
|
|
33
33
|
const vf = validatedFetch({ endpoint, apiKey }, fetchImplementation);
|
|
34
34
|
return {
|
|
35
|
+
// FIXME: implement pagination
|
|
35
36
|
list: async () => vf({
|
|
36
37
|
resource: `devices?${new URLSearchParams({
|
|
37
38
|
pageLimit: '100',
|
package/dist/api/getFOTAJob.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Static } from '@sinclair/typebox';
|
|
2
2
|
import type { ValidationError } from 'ajv';
|
|
3
|
+
import { FwType } from './devices.js';
|
|
3
4
|
export declare enum FOTAJobStatus {
|
|
4
5
|
CREATED = "CREATED",
|
|
5
6
|
IN_PROGRESS = "IN_PROGRESS",
|
|
@@ -11,9 +12,23 @@ export declare const FOTAJobType: import("@sinclair/typebox").TObject<{
|
|
|
11
12
|
jobId: import("@sinclair/typebox").TString;
|
|
12
13
|
status: import("@sinclair/typebox").TEnum<typeof FOTAJobStatus>;
|
|
13
14
|
statusDetail: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
15
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
16
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
14
17
|
createdAt: import("@sinclair/typebox").TString;
|
|
15
18
|
lastUpdatedAt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
16
19
|
completedAt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
20
|
+
firmware: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
21
|
+
bundleId: import("@sinclair/typebox").TString;
|
|
22
|
+
fileSize: import("@sinclair/typebox").TNumber;
|
|
23
|
+
firmwareType: import("@sinclair/typebox").TEnum<typeof FwType>;
|
|
24
|
+
host: import("@sinclair/typebox").TString;
|
|
25
|
+
uris: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
26
|
+
version: import("@sinclair/typebox").TString;
|
|
27
|
+
}>>;
|
|
28
|
+
target: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
29
|
+
deviceIds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
30
|
+
tags: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
31
|
+
}>>;
|
|
17
32
|
}>;
|
|
18
33
|
export declare const getFOTAJob: ({ apiKey, endpoint, }: {
|
|
19
34
|
apiKey: string;
|
package/dist/api/getFOTAJob.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Type } from '@sinclair/typebox';
|
|
2
2
|
import { validatedFetch } from './validatedFetch.js';
|
|
3
|
+
import { FwType } from './devices.js';
|
|
3
4
|
export var FOTAJobStatus;
|
|
4
5
|
(function (FOTAJobStatus) {
|
|
5
6
|
FOTAJobStatus["CREATED"] = "CREATED";
|
|
@@ -25,9 +26,38 @@ export const FOTAJobType = Type.Object({
|
|
|
25
26
|
description: 'Current status of the job',
|
|
26
27
|
}),
|
|
27
28
|
statusDetail: Type.Optional(Type.String({ minLength: 1 })),
|
|
29
|
+
name: Type.Optional(Type.String({ minLength: 1 })),
|
|
30
|
+
description: Type.Optional(Type.String({ minLength: 1 })),
|
|
28
31
|
createdAt: ts,
|
|
29
32
|
lastUpdatedAt: Type.Optional(ts),
|
|
30
33
|
completedAt: Type.Optional(ts),
|
|
34
|
+
firmware: Type.Optional(Type.Object({
|
|
35
|
+
bundleId: Type.String({
|
|
36
|
+
minLength: 1,
|
|
37
|
+
examples: ['APP*439ddbc7*v2.0.0'],
|
|
38
|
+
}),
|
|
39
|
+
fileSize: Type.Number({ minimum: 1, examples: [385068] }),
|
|
40
|
+
firmwareType: Type.Enum(FwType, { title: 'Firmware Type' }),
|
|
41
|
+
host: Type.String({
|
|
42
|
+
minLength: 1,
|
|
43
|
+
examples: ['firmware.nrfcloud.com'],
|
|
44
|
+
}),
|
|
45
|
+
uris: Type.Array(Type.String({
|
|
46
|
+
minLength: 1,
|
|
47
|
+
examples: [
|
|
48
|
+
'bbfe6b73-a46a-43ad-94bd-8e4b4a7847ce/APP*439ddbc7*v2.0.0/hello-nrfcloud-thingy91-v2.0.0-fwupd.bin',
|
|
49
|
+
],
|
|
50
|
+
})),
|
|
51
|
+
version: Type.String({ minLength: 1, examples: ['v2.0.0'] }),
|
|
52
|
+
})),
|
|
53
|
+
target: Type.Optional(Type.Object({
|
|
54
|
+
deviceIds: Type.Array(Type.String({
|
|
55
|
+
minLength: 1,
|
|
56
|
+
title: 'Device ID',
|
|
57
|
+
examples: ['oob-358299840021360'],
|
|
58
|
+
})),
|
|
59
|
+
tags: Type.Array(Type.String({ minLength: 1, title: 'Tag', examples: ['nrf9160'] })),
|
|
60
|
+
})),
|
|
31
61
|
}, {
|
|
32
62
|
title: 'FOTA Job',
|
|
33
63
|
description: 'See https://api.nrfcloud.com/#tag/FOTA-Jobs/operation/FetchFOTAJob',
|