Skip to content

Commit a3787f5

Browse files
committed
0.0.12
1 parent 6ad5da8 commit a3787f5

File tree

7 files changed

+17
-6
lines changed

7 files changed

+17
-6
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@highmobility/auto-api-javascript",
3-
"version": "0.0.11",
3+
"version": "0.0.12",
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",

src/core/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export { AutoApiError, FormatError as JSONError, InvalidCommandError } from './Error';
1+
export { AutoApiError, FormatError, InvalidCommandError } from './Error';
22
export { Capability } from './Capability';
33
export { Command, CommandType } from './Command';
44
export { Property } from './Property';
5+
export { PropertyComponent } from './PropertyComponent';
6+
export { Value } from './Value';

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export * from './core';
44
// Capabilities
55
export * as Capabilities from './capabilities';
66

7+
// Property components
8+
export * from './components';
9+
710
// Configuration
811
export { Configuration } from './configuration';
912

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export interface PropertySetterConstant {
122122
export type PropertySetterConstants = PropertySetterConstant[];
123123

124124
export interface TypeDefinition {
125+
controls?: 'switch' | string;
125126
customType?: string;
126127
enum_values?: EnumValues;
127128
event?: string;
@@ -133,6 +134,7 @@ export interface TypeDefinition {
133134
size?: number;
134135
type: TypeDefinitionType | string;
135136
unitType?: string;
137+
validation?: `min:${number}|max:${number}` | string;
136138
}
137139

138140
export type TypeDefinitions = TypeDefinition[];

src/values/CustomValue.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ export class CustomValue extends Value<CustomValueData, CustomValueSetter> imple
9292
return !!this.definition.items;
9393
}
9494

95+
public get items(): Readonly<CustomValueData> | undefined {
96+
return this._value;
97+
}
98+
9599
public get name() {
96100
return this.definition.name;
97101
}

src/values/TimestampValue.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Value } from '../core/Value';
55

66
import { bytesToInt, decimalToHexArray } from '../utils';
77

8-
export class TimestampValue extends Value<Date> {
8+
export class TimestampValue extends Value<Date, Date | string> {
99
public constructor(value = new Date()) {
1010
super();
1111
this.setValue(value);
@@ -30,8 +30,8 @@ export class TimestampValue extends Value<Date> {
3030
return this;
3131
}
3232

33-
public setValue(value: Date) {
34-
this._value = value;
33+
public setValue(value: Date | string) {
34+
this._value = value instanceof Date ? value : new Date(value);
3535
return this;
3636
}
3737

0 commit comments

Comments
 (0)