@hello.nrfcloud.com/nrfcloud-api-helpers 3.0.1 → 3.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.
@@ -20,4 +20,3 @@ export const DeviceShadow = Type.Object({
20
20
  version: Type.Number(),
21
21
  }),
22
22
  });
23
- ``;
@@ -1,8 +1,9 @@
1
1
  import { type Static } from '@sinclair/typebox';
2
2
  import { ValidationError } from './validatedFetch.js';
3
- declare const Device: import("@sinclair/typebox").TObject<{
4
- id: import("@sinclair/typebox").TString;
5
- state: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
3
+ import { DeviceShadow } from './DeviceShadow.js';
4
+ declare const Devices: import("@sinclair/typebox").TObject<{
5
+ total: import("@sinclair/typebox").TInteger;
6
+ items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
6
7
  id: import("@sinclair/typebox").TString;
7
8
  $meta: import("@sinclair/typebox").TObject<{
8
9
  createdAt: import("@sinclair/typebox").TString;
@@ -15,24 +16,6 @@ declare const Device: import("@sinclair/typebox").TObject<{
15
16
  }>;
16
17
  }>>;
17
18
  }>;
18
- declare const Devices: import("@sinclair/typebox").TObject<{
19
- total: import("@sinclair/typebox").TInteger;
20
- items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
21
- id: import("@sinclair/typebox").TString;
22
- state: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
23
- id: import("@sinclair/typebox").TString;
24
- $meta: import("@sinclair/typebox").TObject<{
25
- createdAt: import("@sinclair/typebox").TString;
26
- updatedAt: import("@sinclair/typebox").TString;
27
- }>;
28
- state: import("@sinclair/typebox").TObject<{
29
- reported: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
30
- desired: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
31
- version: import("@sinclair/typebox").TNumber;
32
- }>;
33
- }>>;
34
- }>>;
35
- }>;
36
19
  type FwType = 'APP' | 'MODEM' | 'BOOT' | 'SOFTDEVICE' | 'BOOTLOADER' | 'MDM_FULL';
37
20
  export declare const devices: ({ endpoint, apiKey, }: {
38
21
  endpoint: URL;
@@ -46,7 +29,7 @@ export declare const devices: ({ endpoint, apiKey, }: {
46
29
  get: (id: string) => Promise<{
47
30
  error: Error | ValidationError;
48
31
  } | {
49
- result: Static<typeof Device>;
32
+ result: Static<typeof DeviceShadow>;
50
33
  }>;
51
34
  updateState: (id: string, state: {
52
35
  desired?: Record<string, any>;
@@ -2,15 +2,11 @@ import { Type } from '@sinclair/typebox';
2
2
  import { slashless } from './slashless.js';
3
3
  import { ValidationError, validatedFetch } from './validatedFetch.js';
4
4
  import { DeviceShadow } from './DeviceShadow.js';
5
- const Device = Type.Object({
6
- id: Type.String(),
7
- state: Type.Optional(DeviceShadow),
8
- });
9
5
  const Page = (Item) => Type.Object({
10
6
  total: Type.Integer(),
11
7
  items: Type.Array(Item),
12
8
  });
13
- const Devices = Page(Device);
9
+ const Devices = Page(DeviceShadow);
14
10
  /**
15
11
  * @link https://api.nrfcloud.com/v1/#tag/IP-Devices/operation/ProvisionDevices
16
12
  */
@@ -30,7 +26,7 @@ export const devices = ({ endpoint, apiKey, }, fetchImplementation) => {
30
26
  deviceNameFuzzy: 'oob-',
31
27
  }).toString()}`,
32
28
  }, Devices),
33
- get: async (id) => vf({ resource: `devices/${encodeURIComponent(id)}` }, Device),
29
+ get: async (id) => vf({ resource: `devices/${encodeURIComponent(id)}` }, DeviceShadow),
34
30
  updateState: async (id, state) => fetch(`${slashless(endpoint)}/v1/devices/${encodeURIComponent(id)}/state`, {
35
31
  headers: {
36
32
  ...headers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hello.nrfcloud.com/nrfcloud-api-helpers",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Helper functions for integrating nRF Cloud APIs in AWS lambdas written in TypeScript.",
5
5
  "exports": {
6
6
  "./*": {
@@ -83,7 +83,7 @@
83
83
  "prettier": "@bifravst/prettier-config",
84
84
  "peerDependencies": {
85
85
  "@aws-sdk/client-dynamodb": "^3.556.0",
86
- "@aws-sdk/client-ssm": "^3.556.0",
86
+ "@aws-sdk/client-ssm": "^3.562.0",
87
87
  "@aws-sdk/util-dynamodb": "^3.556.0",
88
88
  "@bifravst/aws-ssm-settings-helpers": "^1.1.0",
89
89
  "@hello.nrfcloud.com/proto": "^7.3.1",