Skip to content

Commit dce2beb

Browse files
author
KillerJulian
committed
Merge branch 'development'
2 parents 3361e10 + ff24c7e commit dce2beb

File tree

11 files changed

+296
-249
lines changed

11 files changed

+296
-249
lines changed

insomnia.yml

Lines changed: 122 additions & 101 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
"author": "KillerJulian <info@killerjulian.de>",
1010
"license": "MIT",
1111
"dependencies": {
12-
"axios": "^1.4.0",
13-
"tslib": "^2.6.0"
12+
"axios": "^1.6.2",
13+
"tslib": "^2.6.2"
1414
},
1515
"devDependencies": {
16-
"@types/node": "^16.18.39",
17-
"@typescript-eslint/eslint-plugin": "6.1.0",
18-
"@typescript-eslint/parser": "6.1.0",
19-
"eslint": "8.45.0",
20-
"eslint-config-prettier": "8.8.0",
21-
"prettier": "3.0.0",
22-
"typescript": "5.1.6",
23-
"typedoc": "~0.24.8"
16+
"@types/node": "^16.18.65",
17+
"@typescript-eslint/eslint-plugin": "6.12.0",
18+
"@typescript-eslint/parser": "6.12.0",
19+
"eslint": "8.54.0",
20+
"eslint-config-prettier": "9.0.0",
21+
"prettier": "3.1.0",
22+
"typescript": "^5.3.2",
23+
"typedoc": "~0.25.3"
2424
},
2525
"scripts": {
2626
"build": "yarn build:lib && yarn build:docs",

src/api/box/_boxModels.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type BoxData = {
1717
currentLocation: BoxLocation;
1818
loc: BoxLoc[];
1919
updatedAt: RFC3339Date;
20-
sensors: Sensor<Measurement | LastMeasurement | Measurement['_id']>[];
20+
sensors: Sensor<Measurement | LastMeasurement | Measurement['_id'] | null>[];
2121
lastMeasurementAt?: RFC3339Date;
2222
};
2323

@@ -93,7 +93,7 @@ export type TTN = {
9393
* @linkcode https://github.com/sensebox/openSenseMap-API/blob/2e645bdc4c80e668720b5eaaf384a35d2909569e/packages/models/src/sensor/sensor.js#L8
9494
* @linkcode https://github.com/sensebox/openSenseMap-API/blob/2e645bdc4c80e668720b5eaaf384a35d2909569e/packages/models/src/box/box.js#L1057
9595
*/
96-
export type Sensor<T extends Measurement | LastMeasurement | Measurement['_id'] | undefined> = {
96+
export type Sensor<T extends Measurement | LastMeasurement | Measurement['_id'] | null | undefined> = {
9797
_id: OpenSenseMapID;
9898
title: string;
9999
unit: string;

src/api/box/_index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export * from './_boxModels';
66
export * from './claimBox';
77
export * from './createTransfer';
88
export * from './deleteBox';
9+
export * from './getAllTags';
910
export * from './getBox';
1011
export * from './getBoxLocations';
1112
export * from './getBoxes';

src/api/box/deleteBox.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import axios from 'axios';
22
import { OpenSenseMapID } from '../globalTypes';
33

44
/**
5-
* ❗❗ BREAKING CHANGE!
65
* @see https://docs.opensensemap.org/#api-Boxes-deleteBox
76
*/
87
export async function deleteBox(senseBoxId: OpenSenseMapID, password: string, authorization: string): Promise<DeleteBoxResult> {

src/api/box/getAllTags.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import axios from 'axios';
2+
3+
/**
4+
* @see https://docs.opensensemap.org/#api-Boxes-getAllTags
5+
*/
6+
export async function getAllTags(): Promise<GetAllTagsResult> {
7+
return (await axios.get(`https://api.opensensemap.org/tags`)).data;
8+
}
9+
10+
/**
11+
* @linkcode https://github.com/sensebox/openSenseMap-API/blob/11695a33cf0260a62aecbefd76c46735b690be62/packages/api/lib/controllers/boxesController.js#L704C5-L704C5
12+
*/
13+
export type GetAllTagsResult = {
14+
code: 'Ok';
15+
data: string[];
16+
};

src/api/box/postNewBox.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,15 @@ export async function postNewBox(
3333
}
3434

3535
export type PostNewBoxOptions = {
36+
description?: string;
3637
grouptag?: string;
3738
model?: BoxModel;
3839
sensors?: PostNewBoxSensor[];
3940
sensorTemplates?: SensorTemplates[];
41+
serialPort?: 'Serial1' | 'Serial2';
42+
soilDigitalPort?: 'A' | 'B' | 'C';
43+
soundMeterPort?: 'A' | 'B' | 'C';
44+
windSpeedPort?: 'A' | 'B' | 'C';
4045
mqtt?: MQTT;
4146
ttn?: TTN;
4247
useAuth?: boolean;

src/api/user/_userModels.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type UserData = {
1111
boxes: OpenSenseMapID[];
1212
sharedBoxes?: OpenSenseMapID[];
1313
emailIsConfirmed: boolean;
14+
integrations?: object;
1415
};
1516

1617
/**

src/api/user/register.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export async function register(userName: UserName, email: string, password: stri
2121
}
2222

2323
export type RegisterOptions = {
24-
language: Language;
24+
language?: Language;
25+
integrations?: object;
2526
};
2627

2728
/**

src/api/user/updateUser.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export type UpdateUserOptions = {
2828
language?: Language;
2929
name?: string;
3030
newPassword?: string;
31+
integrations?: object;
3132
};
3233

3334
export type UpdateUserResult = UpdateUserResultResultUpdated | UpdateUserResultUserNotUpdated;
@@ -47,12 +48,9 @@ export type UpdateUserResultResultUpdated = {
4748
};
4849

4950
/**
50-
* @linkcode https://github.com/sensebox/openSenseMap-API/blob/2e645bdc4c80e668720b5eaaf384a35d2909569e/packages/models/src/user/user.js#L533
51+
* @linkcode https://github.com/sensebox/openSenseMap-API/blob/11695a33cf0260a62aecbefd76c46735b690be62/packages/api/lib/controllers/usersController.js#L320
5152
*/
5253
export type UpdateUserResultUserNotUpdated = {
5354
code: 'Ok';
54-
message: 'User successfully saved.';
55-
data: {
56-
me: { updated: false };
57-
};
55+
message: 'No changed properties supplied. User remains unchanged.';
5856
};

0 commit comments

Comments
 (0)