@hello.nrfcloud.com/proto-map 13.2.2 → 14.0.0

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.
@@ -0,0 +1,14 @@
1
+ import { Type } from '@sinclair/typebox'
2
+ import { Context } from './Context.js'
3
+
4
+ export const APIHealth = Type.Object(
5
+ {
6
+ '@context': Type.Literal(Context.apiHealth.toString()),
7
+ version: Type.String({
8
+ title: 'Version',
9
+ minLength: 1,
10
+ description: 'The version of the API.',
11
+ }),
12
+ },
13
+ { title: 'APIHealth', description: 'Information about the API.' },
14
+ )
package/api/Context.ts CHANGED
@@ -3,9 +3,10 @@ const baseURL = `https://github.com/hello-nrfcloud/proto-map`
3
3
  export const Context = {
4
4
  device: new URL(`${baseURL}/device`),
5
5
  devices: new URL(`${baseURL}/devices`),
6
+ deviceJWT: new URL(`${baseURL}/device-jwt`),
6
7
  shareDevice: {
7
8
  request: new URL(`${baseURL}/share-device-request`),
8
9
  ownershipConfirmed: new URL(`${baseURL}/share-device-ownership-confirmed`),
9
10
  },
10
- named: (name: string): URL => new URL(`${baseURL}/${name}`),
11
+ apiHealth: new URL(`${baseURL}/api/health`),
11
12
  }
package/api/DeviceId.ts CHANGED
@@ -9,6 +9,6 @@ export const DeviceId = Type.RegExp(/^[a-zA-Z0-9:_-]{1,128}$/, {
9
9
  export const PublicDeviceId = Type.RegExp(/^[a-z]{8}-[a-z]{8}-[a-z]{8}$/, {
10
10
  title: 'Public Device ID',
11
11
  description:
12
- 'This is the format of @nordicsemiconductor/random-words which is used for public IDs.',
12
+ 'This is the format of @bifravst/random-words which is used for public IDs.',
13
13
  examples: ['pentacid-coxalgia-backheel'],
14
14
  })
@@ -0,0 +1,22 @@
1
+ import { Type } from '@sinclair/typebox'
2
+ import { DeviceId, PublicDeviceId } from './DeviceId.js'
3
+ import { Model } from './Devices.js'
4
+ import { Context } from './Context.js'
5
+
6
+ export const DeviceJWT = Type.Object(
7
+ {
8
+ '@context': Type.Literal(Context.deviceJWT.toString()),
9
+ id: PublicDeviceId,
10
+ deviceId: DeviceId,
11
+ model: Model,
12
+ jwt: Type.String({
13
+ title: 'JWT',
14
+ minLength: 5,
15
+ description: 'The JWT for a publicly shared device.',
16
+ examples: [
17
+ 'eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCIsImtpZCI6ImEyMGM0NzZkLTVlZjUtNDE1NS1iODllLTdkZWRiMzJjODVhNCJ9.eyJpZCI6ImQ0OThkNzZhLWQ0ZjktNGQ4YS1iMTYwLTNlODA5NGMzOGNmYSIsImRldmljZUlkIjoidGFsbXVkaWMtb3ZlcnJhdGUtcGVuc2l2ZWQiLCJtb2RlbCI6InRoaW5neTkxeCIsImlhdCI6MTcyMTI4NjA1NywiZXhwIjoxNzIxMjg5NjU3LCJhdWQiOiJoZWxsby5ucmZjbG91ZC5jb20ifQ.Afn2Vj7V4boatn3Dwf4yZCTh09lTpfAEfsaX2uTZv0z2EvcWVH3CeVVsEmvCtDb8mnpvxJcj88-l9PlJqShKzZF5AShz6Ps0Igkzm0PueGjK-nq12I8DTgraT6fdSB3v5ALzLC9ozwyuPN7kJDLMHMHkO3j24sveBvFLg2BLsharSRBN',
18
+ ],
19
+ }),
20
+ },
21
+ { title: 'DeviceJWT', description: 'The JWT for a publicly shared device.' },
22
+ )
package/api/Devices.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Type } from '@sinclair/typebox'
2
2
  import { Context } from './Context.js'
3
- import { PublicDeviceId } from './DeviceId.js'
3
+ import { DeviceId, PublicDeviceId } from './DeviceId.js'
4
4
  import {
5
5
  ObjectID,
6
6
  ObjectInstanceID,
@@ -29,6 +29,7 @@ export const PublicDevice = Type.Object(
29
29
  {
30
30
  '@context': Type.Literal(Context.device.toString()),
31
31
  id: PublicDeviceId,
32
+ deviceId: DeviceId,
32
33
  model: Model,
33
34
  state: Type.Optional(Type.Array(LwM2MObjectInstance)),
34
35
  },
package/api/index.ts CHANGED
@@ -4,3 +4,5 @@ export * from './Devices.js'
4
4
  export * from './ShareDeviceOwnershipConfirmed.js'
5
5
  export * from './ShareDeviceRequest.js'
6
6
  export * from './LwM2M.js'
7
+ export * from './DeviceJWT.js'
8
+ export * from './APIHealth.js'
@@ -0,0 +1,13 @@
1
+ import { Type } from '@sinclair/typebox';
2
+ import { Context } from './Context.js';
3
+ export var APIHealth = Type.Object({
4
+ '@context': Type.Literal(Context.apiHealth.toString()),
5
+ version: Type.String({
6
+ title: 'Version',
7
+ minLength: 1,
8
+ description: 'The version of the API.'
9
+ })
10
+ }, {
11
+ title: 'APIHealth',
12
+ description: 'Information about the API.'
13
+ });
@@ -2,11 +2,10 @@ var baseURL = "https://github.com/hello-nrfcloud/proto-map";
2
2
  export var Context = {
3
3
  device: new URL("".concat(baseURL, "/device")),
4
4
  devices: new URL("".concat(baseURL, "/devices")),
5
+ deviceJWT: new URL("".concat(baseURL, "/device-jwt")),
5
6
  shareDevice: {
6
7
  request: new URL("".concat(baseURL, "/share-device-request")),
7
8
  ownershipConfirmed: new URL("".concat(baseURL, "/share-device-ownership-confirmed"))
8
9
  },
9
- named: function(name) {
10
- return new URL("".concat(baseURL, "/").concat(name));
11
- }
10
+ apiHealth: new URL("".concat(baseURL, "/api/health"))
12
11
  };
@@ -8,7 +8,7 @@ export var DeviceId = Type.RegExp(/^[a-zA-Z0-9:_-]{1,128}$/, {
8
8
  });
9
9
  export var PublicDeviceId = Type.RegExp(/^[a-z]{8}-[a-z]{8}-[a-z]{8}$/, {
10
10
  title: 'Public Device ID',
11
- description: 'This is the format of @nordicsemiconductor/random-words which is used for public IDs.',
11
+ description: 'This is the format of @bifravst/random-words which is used for public IDs.',
12
12
  examples: [
13
13
  'pentacid-coxalgia-backheel'
14
14
  ]
@@ -0,0 +1,21 @@
1
+ import { Type } from '@sinclair/typebox';
2
+ import { DeviceId, PublicDeviceId } from './DeviceId.js';
3
+ import { Model } from './Devices.js';
4
+ import { Context } from './Context.js';
5
+ export var DeviceJWT = Type.Object({
6
+ '@context': Type.Literal(Context.deviceJWT.toString()),
7
+ id: PublicDeviceId,
8
+ deviceId: DeviceId,
9
+ model: Model,
10
+ jwt: Type.String({
11
+ title: 'JWT',
12
+ minLength: 5,
13
+ description: 'The JWT for a publicly shared device.',
14
+ examples: [
15
+ 'eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCIsImtpZCI6ImEyMGM0NzZkLTVlZjUtNDE1NS1iODllLTdkZWRiMzJjODVhNCJ9.eyJpZCI6ImQ0OThkNzZhLWQ0ZjktNGQ4YS1iMTYwLTNlODA5NGMzOGNmYSIsImRldmljZUlkIjoidGFsbXVkaWMtb3ZlcnJhdGUtcGVuc2l2ZWQiLCJtb2RlbCI6InRoaW5neTkxeCIsImlhdCI6MTcyMTI4NjA1NywiZXhwIjoxNzIxMjg5NjU3LCJhdWQiOiJoZWxsby5ucmZjbG91ZC5jb20ifQ.Afn2Vj7V4boatn3Dwf4yZCTh09lTpfAEfsaX2uTZv0z2EvcWVH3CeVVsEmvCtDb8mnpvxJcj88-l9PlJqShKzZF5AShz6Ps0Igkzm0PueGjK-nq12I8DTgraT6fdSB3v5ALzLC9ozwyuPN7kJDLMHMHkO3j24sveBvFLg2BLsharSRBN'
16
+ ]
17
+ })
18
+ }, {
19
+ title: 'DeviceJWT',
20
+ description: 'The JWT for a publicly shared device.'
21
+ });
@@ -1,6 +1,6 @@
1
1
  import { Type } from '@sinclair/typebox';
2
2
  import { Context } from './Context.js';
3
- import { PublicDeviceId } from './DeviceId.js';
3
+ import { DeviceId, PublicDeviceId } from './DeviceId.js';
4
4
  import { ObjectID, ObjectInstanceID, ObjectVersion, Resources } from './LwM2M.js';
5
5
  import { models } from '../models/models.js';
6
6
  export var LwM2MObjectInstance = Type.Object({
@@ -18,6 +18,7 @@ export var Model = Type.Union(Object.keys(models).map(function(s) {
18
18
  export var PublicDevice = Type.Object({
19
19
  '@context': Type.Literal(Context.device.toString()),
20
20
  id: PublicDeviceId,
21
+ deviceId: DeviceId,
21
22
  model: Model,
22
23
  state: Type.Optional(Type.Array(LwM2MObjectInstance))
23
24
  }, {
package/dist/api/index.js CHANGED
@@ -4,3 +4,5 @@ export * from './Devices.js';
4
4
  export * from './ShareDeviceOwnershipConfirmed.js';
5
5
  export * from './ShareDeviceRequest.js';
6
6
  export * from './LwM2M.js';
7
+ export * from './DeviceJWT.js';
8
+ export * from './APIHealth.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hello.nrfcloud.com/proto-map",
3
- "version": "13.2.2",
3
+ "version": "14.0.0",
4
4
  "description": "Documents the communication protocol between devices, the hello.nrfcloud.com/map backend and web application",
5
5
  "type": "module",
6
6
  "exports": {
@@ -35,16 +35,16 @@
35
35
  "prepublishOnly": "./compile.sh"
36
36
  },
37
37
  "devDependencies": {
38
- "@bifravst/eslint-config-typescript": "6.1.8",
39
- "@bifravst/prettier-config": "1.0.3",
38
+ "@bifravst/eslint-config-typescript": "6.1.10",
39
+ "@bifravst/prettier-config": "1.0.4",
40
40
  "@commitlint/config-conventional": "19.2.2",
41
41
  "@swc/cli": "0.4.0",
42
- "@swc/core": "1.6.6",
43
- "@types/node": "20.14.9",
42
+ "@swc/core": "1.7.0",
43
+ "@types/node": "20.14.11",
44
44
  "@types/xml2js": "0.4.14",
45
45
  "chalk": "5.3.0",
46
46
  "globstar": "1.0.0",
47
- "husky": "9.0.11",
47
+ "husky": "9.1.0",
48
48
  "lint-staged": "15.2.7",
49
49
  "prettier-plugin-organize-imports": "4.0.0",
50
50
  "remark": "15.0.1",