Skip to content

Commit 6960570

Browse files
authored
1.3.0 (#318)
* Add AutoAPI L13.2 changes * Upgrade dependencies * Implement Property tags
1 parent df4e7a9 commit 6960570

15 files changed

+1528
-1062
lines changed

package-lock.json

Lines changed: 1469 additions & 1030 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@highmobility/auto-api-javascript",
3-
"version": "1.2.2",
3+
"version": "1.3.0",
44
"description": "Auto API for JavaScript - the parsing library for the Auto API vehicle data model",
55
"main": "lib/index.js",
66
"module": "es/index.js",
@@ -38,33 +38,33 @@
3838
"@tsconfig/node14": "^1.0.3",
3939
"@types/lodash.clonedeep": "^4.5.7",
4040
"@types/lodash.get": "^4.4.7",
41-
"@types/node": "^18.7.1",
41+
"@types/node": "^18.13.0",
4242
"@types/yamljs": "^0.2.31",
43-
"@typescript-eslint/eslint-plugin": "^5.33.0",
44-
"@typescript-eslint/parser": "^5.33.0",
45-
"eslint": "^8.21.0",
46-
"eslint-config-prettier": "^8.5.0",
43+
"@typescript-eslint/eslint-plugin": "^5.51.0",
44+
"@typescript-eslint/parser": "^5.51.0",
45+
"eslint": "^8.33.0",
46+
"eslint-config-prettier": "^8.6.0",
4747
"eslint-import-resolver-alias": "^1.1.2",
48-
"eslint-plugin-import": "^2.26.0",
48+
"eslint-plugin-import": "^2.27.5",
4949
"eslint-plugin-prettier": "^4.2.1",
50-
"husky": "^8.0.1",
51-
"jest": "^28.1.3",
52-
"lint-staged": "^13.0.3",
50+
"husky": "^8.0.3",
51+
"jest": "^29.4.2",
52+
"lint-staged": "^13.1.1",
5353
"npm-run-all": "^4.1.5",
54-
"prettier": "^2.7.1",
55-
"rimraf": "^3.0.2",
56-
"ts-jest": "^28.0.7",
54+
"prettier": "^2.8.4",
55+
"rimraf": "^4.1.2",
56+
"ts-jest": "^29.0.5",
5757
"ts-node": "^10.9.1",
58-
"tsconfig-paths": "^4.1.0",
59-
"typescript": "^4.7.4",
58+
"tsconfig-paths": "^4.1.2",
59+
"typescript": "^4.9.5",
6060
"yamljs": "^0.3.0"
6161
},
6262
"dependencies": {
6363
"abab": "^2.0.6",
6464
"ieee754": "^1.2.1",
6565
"lodash.clonedeep": "^4.5.0",
6666
"lodash.get": "^4.4.2",
67-
"tslib": "^2.4.0"
67+
"tslib": "^2.5.0"
6868
},
6969
"husky": {
7070
"hooks": {

scripts/generate-capabilities.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ function createConstructorDeclaration(className: string) {
6060

6161
function createIdentifierDeclaration({ identifier }: Capability) {
6262
return ts.factory.createPropertyDeclaration(
63-
undefined,
6463
[
6564
ts.factory.createModifier(ts.SyntaxKind.StaticKeyword),
6665
ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword),
@@ -86,7 +85,6 @@ function createIdentifierDeclaration({ identifier }: Capability) {
8685

8786
function createNameDeclaration(name: string) {
8887
return ts.factory.createPropertyDeclaration(
89-
undefined,
9088
[
9189
ts.factory.createModifier(ts.SyntaxKind.StaticKeyword),
9290
ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword),
@@ -100,7 +98,6 @@ function createNameDeclaration(name: string) {
10098

10199
function createPropertiesDeclaration() {
102100
return ts.factory.createPropertyDeclaration(
103-
undefined,
104101
[
105102
ts.factory.createModifier(ts.SyntaxKind.StaticKeyword),
106103
ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword),
@@ -118,7 +115,6 @@ function createPropertiesEnumDeclaration(
118115
exportDeclaration = false,
119116
) {
120117
return ts.factory.createEnumDeclaration(
121-
undefined,
122118
exportDeclaration ? [ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)] : undefined,
123119
ts.factory.createIdentifier(token),
124120
properties
@@ -135,7 +131,6 @@ function createPropertiesEnumDeclaration(
135131

136132
function createCapabilityClassDefinition(className: string, capability: Capability) {
137133
return ts.factory.createClassDeclaration(
138-
undefined,
139134
[ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)],
140135
className,
141136
undefined,
@@ -163,7 +158,6 @@ function createCapabilityClassDefinition(className: string, capability: Capabili
163158

164159
function createCapabilityClassTypeDefinition(classNames: string[]) {
165160
return ts.factory.createTypeAliasDeclaration(
166-
undefined,
167161
[ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)],
168162
ts.factory.createIdentifier(ClassTypeIdentifier),
169163
undefined,

scripts/generate-configuration.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
5151
case 'park_assists':
5252
return 'location';
5353
}
54+
break;
5455

5556
case 'charging':
5657
switch (propertyName) {
@@ -59,6 +60,7 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
5960
case 'reduction_times':
6061
return 'start_stop';
6162
}
63+
break;
6264

6365
case 'chassis_settings':
6466
switch (propertyName) {
@@ -67,18 +69,21 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
6769
case 'minimum_spring_rates':
6870
return 'axle';
6971
}
72+
break;
7073

7174
case 'climate':
7275
switch (propertyName) {
7376
case 'hvac_weekday_starting_times':
7477
return 'weekday';
7578
}
79+
break;
7680

7781
case 'crash':
7882
switch (propertyName) {
7983
case 'incidents':
8084
return 'location';
8185
}
86+
break;
8287

8388
case 'dashboard_lights':
8489
switch (propertyName) {
@@ -87,6 +92,7 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
8792
case 'dashboard_lights':
8893
return 'name';
8994
}
95+
break;
9096

9197
case 'diagnostics':
9298
switch (propertyName) {
@@ -101,6 +107,7 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
101107
case 'wheel_rpms':
102108
return 'location';
103109
}
110+
break;
104111

105112
case 'doors':
106113
switch (propertyName) {
@@ -109,6 +116,7 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
109116
case 'positions':
110117
return 'location';
111118
}
119+
break;
112120

113121
case 'lights':
114122
switch (propertyName) {
@@ -117,6 +125,7 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
117125
case 'reading_lamps':
118126
return 'location';
119127
}
128+
break;
120129

121130
case 'maintenance':
122131
switch (propertyName) {
@@ -125,6 +134,7 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
125134
case 'brakes_service_statuses':
126135
return 'axle';
127136
}
137+
break;
128138

129139
case 'race':
130140
switch (propertyName) {
@@ -133,13 +143,15 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
133143
case 'brake_torque_vectorings':
134144
return 'axle';
135145
}
146+
break;
136147

137148
case 'seats':
138149
switch (propertyName) {
139150
case 'persons_detected':
140151
case 'seatbelts_state':
141152
return 'location';
142153
}
154+
break;
143155

144156
case 'tachograph':
145157
switch (propertyName) {
@@ -148,6 +160,7 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
148160
case 'drivers_time_states':
149161
return 'driver_number';
150162
}
163+
break;
151164

152165
case 'trips':
153166
switch (propertyName) {
@@ -156,20 +169,26 @@ export const getPropertyIdentityKey = (capabilityName: string) => (propertyName:
156169
case 'thresholds':
157170
return 'type';
158171
}
172+
break;
159173

160174
case 'usage':
161175
switch (propertyName) {
176+
case 'acceleration_durations':
177+
return 'direction';
178+
162179
case 'driving_modes_activation_periods':
163180
case 'driving_modes_energy_consumptions':
164181
return 'driving_mode';
165182
}
183+
break;
166184

167185
case 'windows':
168186
switch (propertyName) {
169187
case 'open_percentages':
170188
case 'positions':
171189
return 'location';
172190
}
191+
break;
173192
}
174193
};
175194

scripts/generate-property-components.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ function createConstructorDeclaration({ name }: PropertyComponent) {
4545
],
4646
[
4747
ts.factory.createParameterDeclaration(
48-
undefined,
4948
[
5049
ts.factory.createModifier(ts.SyntaxKind.PublicKeyword),
5150
ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword),
@@ -67,7 +66,6 @@ function createConstructorDeclaration({ name }: PropertyComponent) {
6766

6867
function createDataComponentValueTypeDefinitionOverride() {
6968
return ts.factory.createMethodDeclaration(
70-
undefined,
7169
[ts.factory.createModifier(ts.SyntaxKind.ProtectedKeyword)],
7270
undefined,
7371
ts.factory.createIdentifier('getValueTypeDefinition'),
@@ -91,7 +89,6 @@ function createDataComponentValueTypeDefinitionOverride() {
9189

9290
function createPropertyComponentClassDefinition(className: string, component: PropertyComponent) {
9391
return ts.factory.createClassDeclaration(
94-
undefined,
9592
[ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)],
9693
className,
9794
undefined,
@@ -112,7 +109,6 @@ function createPropertyComponentClassDefinition(className: string, component: Pr
112109

113110
function createPropertyComponentNameDeclaration(components: PropertyComponents) {
114111
return ts.factory.createTypeAliasDeclaration(
115-
undefined,
116112
[ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)],
117113
ts.factory.createIdentifier(ComponentNameTypeName),
118114
undefined,

scripts/shared/typescript.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export function createConstructorDeclaration(
55
parameters: ts.ParameterDeclaration[] = [],
66
) {
77
return ts.factory.createConstructorDeclaration(
8-
undefined,
98
undefined,
109
parameters,
1110
ts.factory.createBlock(statements, true),
@@ -14,7 +13,6 @@ export function createConstructorDeclaration(
1413

1514
export function createExportDeclaration(source: string, identifier: string) {
1615
return ts.factory.createExportDeclaration(
17-
undefined,
1816
undefined,
1917
false,
2018
ts.factory.createNamedExports([
@@ -26,7 +24,6 @@ export function createExportDeclaration(source: string, identifier: string) {
2624

2725
export function createImportDeclaration(source: string, identifier: string) {
2826
return ts.factory.createImportDeclaration(
29-
undefined,
3027
undefined,
3128
ts.factory.createImportClause(
3229
false,

src/capabilities/Charging.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ enum Properties {
77
AcousticLimit = 'acoustic_limit',
88
AuxiliaryPower = 'auxiliary_power',
99
BatteryCapacity = 'battery_capacity',
10+
BatteryChargeType = 'battery_charge_type',
1011
BatteryCoolingTemperature = 'battery_cooling_temperature',
1112
BatteryCurrent = 'battery_current',
1213
BatteryCurrentAc = 'battery_current_ac',
@@ -42,6 +43,7 @@ enum Properties {
4243
CurrentType = 'current_type',
4344
DepartureTimeDisplay = 'departure_time_display',
4445
DepartureTimes = 'departure_times',
46+
DrivingModePhev = 'driving_mode_phev',
4547
EstimatedRange = 'estimated_range',
4648
EstimatedRangeTarget = 'estimated_range_target',
4749
FlapLockStatus = 'flap_lock_status',

src/capabilities/Diagnostics.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ enum Properties {
4545
MileageMeters = 'mileage_meters',
4646
Odometer = 'odometer',
4747
OemTroubleCodeValues = 'oem_trouble_code_values',
48+
PassengerAirbagStatus = 'passenger_airbag_status',
4849
Speed = 'speed',
4950
TirePressureStatuses = 'tire_pressure_statuses',
5051
TirePressures = 'tire_pressures',

src/capabilities/Race.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { UniversalProperties } from './properties';
55

66
enum Properties {
77
Accelerations = 'accelerations',
8+
AcceleratorDurations = 'accelerator_durations',
89
AcceleratorPedalIdleSwitch = 'accelerator_pedal_idle_switch',
910
AcceleratorPedalKickdownSwitch = 'accelerator_pedal_kickdown_switch',
1011
BrakePedalPosition = 'brake_pedal_position',

0 commit comments

Comments
 (0)