Skip to content

Commit 8fefea1

Browse files
committed
fix(TS): regenerate TS with better handling undefined array type property in fromJS()
1 parent 69b1a34 commit 8fefea1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+61
-60
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ts-sdk:
2929

3030
ts-build:
3131
cd ./src/TypeScriptSDK && npm i
32+
cd ./src/TypeScriptSDK && npm i honeybee-schema
3233
cd ./src/TypeScriptSDK && npm version $(NEW_RELEASE_VERSION) --allow-same-version && npm run custom-pack
3334
cp ./src/TypeScriptSDK/*.tgz ./
3435

src/TypeScriptSDK/src/models/Building.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class Building extends IDdBaseModel {
5959
override init(_data?: any) {
6060
super.init(_data);
6161
if (_data) {
62-
const obj = plainToClass(Building, _data, { enableImplicitConversion: true, exposeUnsetFields: false });
62+
const obj = plainToClass(Building, _data, { enableImplicitConversion: true, exposeUnsetFields: false, exposeDefaultValues: true });
6363
this.properties = obj.properties;
6464
this.type = obj.type ?? "Building";
6565
this.uniqueStories = obj.uniqueStories;

src/TypeScriptSDK/src/models/BuildingEnergyPropertiesAbridged.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class BuildingEnergyPropertiesAbridged extends _OpenAPIGenBaseModel {
4545
override init(_data?: any) {
4646
super.init(_data);
4747
if (_data) {
48-
const obj = plainToClass(BuildingEnergyPropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false });
48+
const obj = plainToClass(BuildingEnergyPropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false, exposeDefaultValues: true });
4949
this.type = obj.type ?? "BuildingEnergyPropertiesAbridged";
5050
this.constructionSet = obj.constructionSet;
5151
this.ceilingPlenumConstruction = obj.ceilingPlenumConstruction;

src/TypeScriptSDK/src/models/BuildingPropertiesAbridged.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class BuildingPropertiesAbridged extends _OpenAPIGenBaseModel {
3838
override init(_data?: any) {
3939
super.init(_data);
4040
if (_data) {
41-
const obj = plainToClass(BuildingPropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false });
41+
const obj = plainToClass(BuildingPropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false, exposeDefaultValues: true });
4242
this.type = obj.type ?? "BuildingPropertiesAbridged";
4343
this.energy = obj.energy;
4444
this.radiance = obj.radiance;

src/TypeScriptSDK/src/models/BuildingRadiancePropertiesAbridged.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class BuildingRadiancePropertiesAbridged extends _OpenAPIGenBaseModel {
2727
override init(_data?: any) {
2828
super.init(_data);
2929
if (_data) {
30-
const obj = plainToClass(BuildingRadiancePropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false });
30+
const obj = plainToClass(BuildingRadiancePropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false, exposeDefaultValues: true });
3131
this.type = obj.type ?? "BuildingRadiancePropertiesAbridged";
3232
this.modifierSet = obj.modifierSet;
3333
}

src/TypeScriptSDK/src/models/ContextShade.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class ContextShade extends IDdBaseModel {
1010
@IsArray()
1111
@IsDefined()
1212
@Expose({ name: "geometry" })
13-
@Transform(({ value }) => value.map((item: any) => {
13+
@Transform(({ value }) => value?.map((item: any) => {
1414
if (item?.type === 'Face3D') return Face3D.fromJS(item);
1515
else if (item?.type === 'Mesh3D') return Mesh3D.fromJS(item);
1616
else return item;
@@ -50,7 +50,7 @@ export class ContextShade extends IDdBaseModel {
5050
override init(_data?: any) {
5151
super.init(_data);
5252
if (_data) {
53-
const obj = plainToClass(ContextShade, _data, { enableImplicitConversion: true, exposeUnsetFields: false });
53+
const obj = plainToClass(ContextShade, _data, { enableImplicitConversion: true, exposeUnsetFields: false, exposeDefaultValues: true });
5454
this.geometry = obj.geometry;
5555
this.properties = obj.properties;
5656
this.type = obj.type ?? "ContextShade";

src/TypeScriptSDK/src/models/ContextShadeEnergyPropertiesAbridged.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class ContextShadeEnergyPropertiesAbridged extends _OpenAPIGenBaseModel {
3737
override init(_data?: any) {
3838
super.init(_data);
3939
if (_data) {
40-
const obj = plainToClass(ContextShadeEnergyPropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false });
40+
const obj = plainToClass(ContextShadeEnergyPropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false, exposeDefaultValues: true });
4141
this.type = obj.type ?? "ContextShadeEnergyPropertiesAbridged";
4242
this.construction = obj.construction;
4343
this.transmittanceSchedule = obj.transmittanceSchedule;

src/TypeScriptSDK/src/models/ContextShadePropertiesAbridged.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class ContextShadePropertiesAbridged extends _OpenAPIGenBaseModel {
3838
override init(_data?: any) {
3939
super.init(_data);
4040
if (_data) {
41-
const obj = plainToClass(ContextShadePropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false });
41+
const obj = plainToClass(ContextShadePropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false, exposeDefaultValues: true });
4242
this.type = obj.type ?? "ContextShadePropertiesAbridged";
4343
this.energy = obj.energy;
4444
this.radiance = obj.radiance;

src/TypeScriptSDK/src/models/ContextShadeRadiancePropertiesAbridged.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class ContextShadeRadiancePropertiesAbridged extends _OpenAPIGenBaseModel
2727
override init(_data?: any) {
2828
super.init(_data);
2929
if (_data) {
30-
const obj = plainToClass(ContextShadeRadiancePropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false });
30+
const obj = plainToClass(ContextShadeRadiancePropertiesAbridged, _data, { enableImplicitConversion: true, exposeUnsetFields: false, exposeDefaultValues: true });
3131
this.type = obj.type ?? "ContextShadeRadiancePropertiesAbridged";
3232
this.modifier = obj.modifier;
3333
}

0 commit comments

Comments
 (0)