@hello.nrfcloud.com/nrfcloud-api-helpers 5.3.37 → 5.3.39
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/DeviceShadow.spec.js +2 -2
- package/dist/api/bulkOps.d.ts +1 -1
- package/dist/api/createFOTAJob.d.ts +1 -1
- package/dist/api/getAccountInfo.d.ts +1 -1
- package/dist/api/getAccountInfo.spec.js +2 -2
- package/dist/api/getCurrentMonthlyCosts.d.ts +1 -1
- package/dist/api/getCurrentMonthlyCosts.js +1 -1
- package/dist/api/getCurrentMonthlyCosts.spec.js +1 -1
- package/dist/api/getDeviceShadow.d.ts +1 -1
- package/dist/api/getDeviceShadow.js +1 -1
- package/dist/api/getDeviceShadow.spec.js +1 -1
- package/dist/api/getFOTABundle.spec.js +1 -1
- package/dist/api/getFOTABundles.d.ts +1 -1
- package/dist/api/getFOTABundles.js +1 -1
- package/dist/api/getFOTAJob.d.ts +1 -1
- package/dist/api/getFOTAJob.js +1 -1
- package/dist/api/getLocationHistory.d.ts +1 -1
- package/dist/api/getLocationHistory.spec.js +2 -2
- package/dist/api/groundFix.d.ts +1 -1
- package/dist/api/index.d.ts +13 -13
- package/dist/api/index.js +13 -13
- package/dist/api/serviceToken.d.ts +1 -1
- package/dist/api/slashless.spec.js +1 -1
- package/dist/api/validatedFetch.spec.js +3 -3
- package/dist/settings/getAllAccountsSettings.js +1 -1
- package/dist/settings/groupByAccount.spec.js +1 -1
- package/dist/settings/index.d.ts +2 -2
- package/dist/settings/index.js +2 -2
- package/dist/settings/settings.js +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
1
|
import { validateWithTypeBox } from '@hello.nrfcloud.com/proto';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { describe, it } from 'node:test';
|
|
4
4
|
import { DeviceShadow } from './DeviceShadow.js';
|
|
5
5
|
void describe('DeviceShadow type', () => {
|
|
6
6
|
void it('should document the device shadow object', () => {
|
package/dist/api/bulkOps.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Static } from '@sinclair/typebox';
|
|
2
|
-
import { type ValidationError } from './validatedFetch.js';
|
|
3
2
|
import type { FetchError } from './FetchError.js';
|
|
3
|
+
import { type ValidationError } from './validatedFetch.js';
|
|
4
4
|
/**
|
|
5
5
|
* @link https://api.nrfcloud.com/v1/#tag/Bulk-Ops-Requests/operation/FetchBulkOpsRequest
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Static } from '@sinclair/typebox';
|
|
2
|
-
import type { ValidationError } from './validatedFetch.js';
|
|
3
2
|
import type { FetchError } from './FetchError.js';
|
|
3
|
+
import type { ValidationError } from './validatedFetch.js';
|
|
4
4
|
export declare const CreatedFOTAJobType: import("@sinclair/typebox").TObject<{
|
|
5
5
|
jobId: import("@sinclair/typebox").TString;
|
|
6
6
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Static } from '@sinclair/typebox';
|
|
2
|
-
import type { ValidationError } from './validatedFetch.js';
|
|
3
2
|
import type { FetchError } from './FetchError.js';
|
|
3
|
+
import type { ValidationError } from './validatedFetch.js';
|
|
4
4
|
declare const AccountInfoType: import("@sinclair/typebox").TObject<{
|
|
5
5
|
mqttEndpoint: import("@sinclair/typebox").TString;
|
|
6
6
|
mqttTopicPrefix: import("@sinclair/typebox").TString;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
1
|
import assert from 'node:assert/strict';
|
|
2
|
+
import { describe, it } from 'node:test';
|
|
3
|
+
import { check, objectMatching } from 'tsmatchers';
|
|
3
4
|
import { getAccountInfo } from './getAccountInfo.js';
|
|
4
5
|
import APIresponse from './test-data/account.json';
|
|
5
|
-
import { check, objectMatching } from 'tsmatchers';
|
|
6
6
|
void describe('getAccountInfo()', () => {
|
|
7
7
|
void it('return the account info', async () => {
|
|
8
8
|
const res = await getAccountInfo({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ValidationError } from './validatedFetch.js';
|
|
2
1
|
import type { FetchError } from './FetchError.js';
|
|
2
|
+
import type { ValidationError } from './validatedFetch.js';
|
|
3
3
|
export declare const getCurrentMonthlyCosts: ({ apiKey, endpoint, }: {
|
|
4
4
|
apiKey: string;
|
|
5
5
|
endpoint: URL;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { validatedFetch } from './validatedFetch.js';
|
|
2
1
|
import { Type } from '@sinclair/typebox';
|
|
2
|
+
import { validatedFetch } from './validatedFetch.js';
|
|
3
3
|
export const getCurrentMonthlyCosts = ({ apiKey, endpoint, }, fetchImplementation) => async () => {
|
|
4
4
|
const vf = validatedFetch({ endpoint, apiKey }, fetchImplementation);
|
|
5
5
|
const maybeResult = await vf({ resource: 'account' }, Type.Object({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
1
|
import assert from 'node:assert/strict';
|
|
2
|
+
import { describe, it } from 'node:test';
|
|
3
3
|
import { getCurrentMonthlyCosts } from './getCurrentMonthlyCosts.js';
|
|
4
4
|
import APIresponse from './test-data/account.json';
|
|
5
5
|
void describe('getCurrentMonthlyCosts()', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Static } from '@sinclair/typebox';
|
|
2
|
-
import type { ValidationError } from './validatedFetch.js';
|
|
3
2
|
import type { FetchError } from './FetchError.js';
|
|
3
|
+
import type { ValidationError } from './validatedFetch.js';
|
|
4
4
|
declare const DeviceShadows: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
5
5
|
id: import("@sinclair/typebox").TString;
|
|
6
6
|
$meta: import("@sinclair/typebox").TObject<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type } from '@sinclair/typebox';
|
|
2
|
-
import { validatedFetch } from './validatedFetch.js';
|
|
3
2
|
import { DeviceShadow } from './DeviceShadow.js';
|
|
3
|
+
import { validatedFetch } from './validatedFetch.js';
|
|
4
4
|
const DeviceShadows = Type.Array(DeviceShadow);
|
|
5
5
|
/**
|
|
6
6
|
* @see https://api.nrfcloud.com/v1#tag/All-Devices/operation/ListDevices
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { describe, it, mock } from 'node:test';
|
|
2
1
|
import assert from 'node:assert/strict';
|
|
2
|
+
import { describe, it, mock } from 'node:test';
|
|
3
3
|
import { getDeviceShadow } from './getDeviceShadow.js';
|
|
4
4
|
void describe('getDeviceShadow()', () => {
|
|
5
5
|
void it('should accept a response without pagination and total devices', async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { describe, it, mock } from 'node:test';
|
|
2
1
|
import assert from 'node:assert/strict';
|
|
2
|
+
import { describe, it, mock } from 'node:test';
|
|
3
3
|
import { getFOTABundles } from './getFOTABundles.js';
|
|
4
4
|
void describe('getFOTABundles()', () => {
|
|
5
5
|
void it('should fetch all FOTA bundles', async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Static } from '@sinclair/typebox';
|
|
2
|
-
import type { ValidationError } from './validatedFetch.js';
|
|
3
2
|
import { FwType } from './devices.js';
|
|
4
3
|
import type { FetchError } from './FetchError.js';
|
|
4
|
+
import type { ValidationError } from './validatedFetch.js';
|
|
5
5
|
export declare const FOTABundle: import("@sinclair/typebox").TObject<{
|
|
6
6
|
bundleId: import("@sinclair/typebox").TString;
|
|
7
7
|
lastModified: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type } from '@sinclair/typebox';
|
|
2
|
-
import { validatedFetch } from './validatedFetch.js';
|
|
3
2
|
import { FwType } from './devices.js';
|
|
3
|
+
import { validatedFetch } from './validatedFetch.js';
|
|
4
4
|
export const FOTABundle = Type.Object({
|
|
5
5
|
bundleId: Type.String({
|
|
6
6
|
minLength: 1,
|
package/dist/api/getFOTAJob.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Static } from '@sinclair/typebox';
|
|
2
|
-
import type { ValidationError } from './validatedFetch.js';
|
|
3
2
|
import { FwType } from './devices.js';
|
|
4
3
|
import type { FetchError } from './FetchError.js';
|
|
4
|
+
import type { ValidationError } from './validatedFetch.js';
|
|
5
5
|
export declare enum FOTAJobStatus {
|
|
6
6
|
CREATED = "CREATED",
|
|
7
7
|
IN_PROGRESS = "IN_PROGRESS",
|
package/dist/api/getFOTAJob.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type } from '@sinclair/typebox';
|
|
2
|
-
import { validatedFetch } from './validatedFetch.js';
|
|
3
2
|
import { FwType } from './devices.js';
|
|
3
|
+
import { validatedFetch } from './validatedFetch.js';
|
|
4
4
|
export var FOTAJobStatus;
|
|
5
5
|
(function (FOTAJobStatus) {
|
|
6
6
|
FOTAJobStatus["CREATED"] = "CREATED";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Static } from '@sinclair/typebox';
|
|
2
|
-
import type { ValidationError } from './validatedFetch.js';
|
|
3
2
|
import type { FetchError } from './FetchError.js';
|
|
3
|
+
import type { ValidationError } from './validatedFetch.js';
|
|
4
4
|
export declare enum LocationHistoryServiceType {
|
|
5
5
|
ANCHOR = "ANCHOR",
|
|
6
6
|
GNSS = "GNSS",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
1
|
import assert from 'node:assert/strict';
|
|
2
|
+
import { describe, it } from 'node:test';
|
|
3
|
+
import { aString, arrayMatching, check, objectMatching } from 'tsmatchers';
|
|
3
4
|
import { getLocationHistory } from './getLocationHistory.js';
|
|
4
5
|
import APIresponse from './test-data/location.json';
|
|
5
|
-
import { aString, arrayMatching, check, objectMatching } from 'tsmatchers';
|
|
6
6
|
await describe('getLocationHistory()', async () => {
|
|
7
7
|
await it('return the location history', async () => {
|
|
8
8
|
const res = await getLocationHistory({
|
package/dist/api/groundFix.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Static } from '@sinclair/typebox';
|
|
2
|
-
import { type ValidationError } from './validatedFetch.js';
|
|
3
2
|
import type { FetchError } from './FetchError.js';
|
|
3
|
+
import { type ValidationError } from './validatedFetch.js';
|
|
4
4
|
export declare const lat: import("@sinclair/typebox").TNumber;
|
|
5
5
|
export declare const lng: import("@sinclair/typebox").TNumber;
|
|
6
6
|
export declare const accuracy: import("@sinclair/typebox").TNumber;
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './devices.js';
|
|
3
|
-
export * from './getCurrentMonthlyCosts.js';
|
|
1
|
+
export * from './bulkOps.js';
|
|
4
2
|
export * from './createAccountDevice.js';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './getAccountInfo.js';
|
|
7
|
-
export * from './getLocationHistory.js';
|
|
3
|
+
export * from './createFOTAJob.js';
|
|
8
4
|
export * from './deleteAccountDevice.js';
|
|
9
|
-
export * from './
|
|
5
|
+
export * from './devices.js';
|
|
10
6
|
export * from './DeviceShadow.js';
|
|
11
|
-
export * from './serviceToken.js';
|
|
12
|
-
export * from './groundFix.js';
|
|
13
|
-
export * from './bulkOps.js';
|
|
14
|
-
export * from './createFOTAJob.js';
|
|
15
|
-
export * from './getFOTAJob.js';
|
|
16
|
-
export * from './getFOTABundles.js';
|
|
17
7
|
export * from './FetchError.js';
|
|
8
|
+
export * from './getAccountInfo.js';
|
|
9
|
+
export * from './getCurrentMonthlyCosts.js';
|
|
10
|
+
export * from './getDeviceShadow.js';
|
|
11
|
+
export * from './getFOTABundles.js';
|
|
12
|
+
export * from './getFOTAJob.js';
|
|
13
|
+
export * from './getLocationHistory.js';
|
|
14
|
+
export * from './groundFix.js';
|
|
15
|
+
export * from './serviceToken.js';
|
|
16
|
+
export * from './slashless.js';
|
|
17
|
+
export * from './validatedFetch.js';
|
package/dist/api/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './devices.js';
|
|
3
|
-
export * from './getCurrentMonthlyCosts.js';
|
|
1
|
+
export * from './bulkOps.js';
|
|
4
2
|
export * from './createAccountDevice.js';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './getAccountInfo.js';
|
|
7
|
-
export * from './getLocationHistory.js';
|
|
3
|
+
export * from './createFOTAJob.js';
|
|
8
4
|
export * from './deleteAccountDevice.js';
|
|
9
|
-
export * from './
|
|
5
|
+
export * from './devices.js';
|
|
10
6
|
export * from './DeviceShadow.js';
|
|
11
|
-
export * from './serviceToken.js';
|
|
12
|
-
export * from './groundFix.js';
|
|
13
|
-
export * from './bulkOps.js';
|
|
14
|
-
export * from './createFOTAJob.js';
|
|
15
|
-
export * from './getFOTAJob.js';
|
|
16
|
-
export * from './getFOTABundles.js';
|
|
17
7
|
export * from './FetchError.js';
|
|
8
|
+
export * from './getAccountInfo.js';
|
|
9
|
+
export * from './getCurrentMonthlyCosts.js';
|
|
10
|
+
export * from './getDeviceShadow.js';
|
|
11
|
+
export * from './getFOTABundles.js';
|
|
12
|
+
export * from './getFOTAJob.js';
|
|
13
|
+
export * from './getLocationHistory.js';
|
|
14
|
+
export * from './groundFix.js';
|
|
15
|
+
export * from './serviceToken.js';
|
|
16
|
+
export * from './slashless.js';
|
|
17
|
+
export * from './validatedFetch.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
1
|
import assert from 'node:assert/strict';
|
|
2
|
+
import { describe, it } from 'node:test';
|
|
3
3
|
import { slashless } from './slashless.js';
|
|
4
4
|
void describe('slashless()', () => {
|
|
5
5
|
void it('should remove the slash from an URL and convert it to a string', () => assert.equal(slashless(new URL('https://api.nrfcloud.com/')), 'https://api.nrfcloud.com'));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { describe, it, mock } from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
1
|
import { Type } from '@sinclair/typebox';
|
|
4
|
-
import
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { describe, it, mock } from 'node:test';
|
|
5
4
|
import { FetchError } from './FetchError.js';
|
|
5
|
+
import { JSONPayload, validatedFetch } from './validatedFetch.js';
|
|
6
6
|
void describe('validatedFetch()', () => {
|
|
7
7
|
void it('should call an nRF Cloud API endpoint and validate the response', async () => {
|
|
8
8
|
const mockFetch = mock.fn(() => ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { get } from '@bifravst/aws-ssm-settings-helpers';
|
|
2
|
-
import { NRFCLOUD_ACCOUNT_SCOPE } from './scope.js';
|
|
3
2
|
import { groupByAccount } from './groupByAccount.js';
|
|
3
|
+
import { NRFCLOUD_ACCOUNT_SCOPE } from './scope.js';
|
|
4
4
|
import { validateSettings } from './settings.js';
|
|
5
5
|
/**
|
|
6
6
|
* Returns settings for all accounts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { it, describe } from 'node:test';
|
|
2
1
|
import assert from 'node:assert/strict';
|
|
2
|
+
import { describe, it } from 'node:test';
|
|
3
3
|
import { groupByAccount } from './groupByAccount.js';
|
|
4
4
|
void describe('groupByAccount()', () => {
|
|
5
5
|
void it('should group settings by account', () => assert.deepEqual(groupByAccount({
|
package/dist/settings/index.d.ts
CHANGED
package/dist/settings/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { remove as deleteSSMSettings, get as getSSMSettings, put as putSSMSettings, } from '@bifravst/aws-ssm-settings-helpers';
|
|
1
2
|
import { NRFCLOUD_ACCOUNT_SCOPE, nrfCloudAccount } from './scope.js';
|
|
2
|
-
import { get as getSSMSettings, put as putSSMSettings, remove as deleteSSMSettings, } from '@bifravst/aws-ssm-settings-helpers';
|
|
3
3
|
export const defaultApiEndpoint = new URL('https://api.nrfcloud.com');
|
|
4
4
|
export const defaultCoAPEndpoint = new URL('coaps://coap.nrfcloud.com');
|
|
5
5
|
export const getSettings = ({ ssm, stackName, account, }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hello.nrfcloud.com/nrfcloud-api-helpers",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.39",
|
|
4
4
|
"description": "Helper functions for integrating nRF Cloud APIs in AWS lambdas written in TypeScript.",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./*": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"license": "BSD-3-Clause",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@bifravst/eslint-config-typescript": "6.1.13",
|
|
36
|
-
"@bifravst/prettier-config": "1.0
|
|
36
|
+
"@bifravst/prettier-config": "1.1.0",
|
|
37
37
|
"@commitlint/config-conventional": "19.2.2",
|
|
38
38
|
"@types/aws-lambda": "8.10.143",
|
|
39
39
|
"@types/node": "20.14.15",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@aws-sdk/client-ssm": "^3.628.0",
|
|
87
87
|
"@aws-sdk/util-dynamodb": "^3.624.0",
|
|
88
88
|
"@bifravst/aws-ssm-settings-helpers": "^1.2.9",
|
|
89
|
-
"@hello.nrfcloud.com/proto": "^14.3.
|
|
89
|
+
"@hello.nrfcloud.com/proto": "^14.3.8",
|
|
90
90
|
"@sinclair/typebox": "^0.33.4"
|
|
91
91
|
}
|
|
92
92
|
}
|