@dnv-plant/typescriptpws 1.0.95 → 1.0.96-alpha.2289077

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.
@@ -1,23 +1,23 @@
1
1
  /***********************************************************************
2
- * This file has been auto-generated by a code generation tool.
3
- *
4
- * DO NOT MODIFY THIS FILE
5
- * This file is maintained by DNV.
6
- * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
7
- * Please contact DNV if you believe changes are required.
8
- *
9
- * Version: 1.0.95
10
- * Date/time: 19 Jan 2026 12:11:52
11
- * Template: templates/typescriptpws/calculations.razor.
12
- ***********************************************************************/
13
-
14
- import * as Enums from "../enums";
15
- import * as Entities from "../entities";
16
- import * as EntitySchemas from "../entity-schemas";
17
- import { getAnalyticsApiTarget, getClientAliasId } from "../utilities";
18
- import { CalculationRequestBase, CalculationBase, CalculationResponseBase } from "./calculationBase"
19
-
20
- import Joi from "joi";
2
+ * This file has been auto-generated by a code generation tool.
3
+ *
4
+ * DO NOT MODIFY THIS FILE
5
+ * This file is maintained by DNV.
6
+ * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
7
+ * Please contact DNV if you believe changes are required.
8
+ *
9
+ * Version: 1.0.96
10
+ * Date/time: 4 Apr 2026 08:17:52
11
+ * Template: templates/typescriptpws/calculations.razor.
12
+ ***********************************************************************/
13
+
14
+ import * as Enums from '../enums';
15
+ import * as Entities from '../entities';
16
+ import * as EntitySchemas from '../entity-schemas';
17
+ import { getAnalyticsApiTarget, getClientAliasId } from '../utilities';
18
+ import { CalculationRequestBase, CalculationBase, CalculationResponseBase } from './calculationBase';
19
+
20
+ import Joi from 'joi';
21
21
 
22
22
  export interface PoolFireCalculationRequestSchemaData {
23
23
  material: Entities.Material;
@@ -41,12 +41,12 @@ class PoolFireCalculationRequest extends CalculationRequestBase {
41
41
  *
42
42
  */
43
43
  constructor(data: {
44
- material: Entities.Material,
45
- poolRecords: Entities.PoolRecord[],
46
- poolRecordCount: number,
47
- weather: Entities.Weather,
48
- substrate: Entities.Substrate,
49
- flammableParameters: Entities.FlammableParameters
44
+ material: Entities.Material;
45
+ poolRecords: Entities.PoolRecord[];
46
+ poolRecordCount: number;
47
+ weather: Entities.Weather;
48
+ substrate: Entities.Substrate;
49
+ flammableParameters: Entities.FlammableParameters;
50
50
  }) {
51
51
  super();
52
52
  this.material = data.material;
@@ -76,19 +76,19 @@ export class PoolFireCalculationRequestSchema {
76
76
  }).unknown(true);
77
77
 
78
78
  this.propertyTypes = {
79
- material: "Entities.Material",
80
- poolRecords: "Entities.PoolRecord[]",
81
- poolRecordCount: "number",
82
- weather: "Entities.Weather",
83
- substrate: "Entities.Substrate",
84
- flammableParameters: "Entities.FlammableParameters",
79
+ material: 'Entities.Material',
80
+ poolRecords: 'Entities.PoolRecord[]',
81
+ poolRecordCount: 'number',
82
+ weather: 'Entities.Weather',
83
+ substrate: 'Entities.Substrate',
84
+ flammableParameters: 'Entities.FlammableParameters',
85
85
  };
86
86
  }
87
87
 
88
88
  validate(data: PoolFireCalculationRequestSchemaData): PoolFireCalculationRequest {
89
89
  const { error, value } = this.schema.validate(data, { abortEarly: false });
90
90
  if (error) {
91
- throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
91
+ throw new Error(`Validation error: ${error.details.map((x) => x.message).join(', ')}`);
92
92
  }
93
93
  return this.makeCalculationRequest(value);
94
94
  }
@@ -113,12 +113,12 @@ export class PoolFireCalculation extends CalculationBase {
113
113
  *
114
114
  */
115
115
  constructor(data: {
116
- material: Entities.Material,
117
- poolRecords: Entities.PoolRecord[],
118
- poolRecordCount: number,
119
- weather: Entities.Weather,
120
- substrate: Entities.Substrate,
121
- flammableParameters: Entities.FlammableParameters
116
+ material: Entities.Material;
117
+ poolRecords: Entities.PoolRecord[];
118
+ poolRecordCount: number;
119
+ weather: Entities.Weather;
120
+ substrate: Entities.Substrate;
121
+ flammableParameters: Entities.FlammableParameters;
122
122
  controller?: AbortController;
123
123
  }) {
124
124
  super(data.controller);
@@ -138,7 +138,7 @@ export class PoolFireCalculation extends CalculationBase {
138
138
  poolRecordCount: this.poolRecordCount,
139
139
  weather: this.weather,
140
140
  substrate: this.substrate,
141
- flammableParameters: this.flammableParameters
141
+ flammableParameters: this.flammableParameters,
142
142
  });
143
143
 
144
144
  const schema = new PoolFireCalculationRequestSchema();
@@ -180,22 +180,18 @@ export class PoolFireCalculation extends CalculationBase {
180
180
  }
181
181
 
182
182
  toString() {
183
- const parts = ["* PoolFire"];
183
+ const parts = ['* PoolFire'];
184
184
 
185
185
  parts.push(`poolFireFlameResult: ${String(this.poolFireFlameResult)}`);
186
- parts.push("*** flameRecords:");
187
- parts.push(
188
- this.flameRecords && this.flameRecords.length > 0
189
- ? this.flameRecords.map((point) => `flameRecordsElement: ${point}`).join("\n")
190
- : "flameRecords does not contain any elements"
191
- );
186
+ parts.push('*** flameRecords:');
187
+ parts.push(this.flameRecords && this.flameRecords.length > 0 ? this.flameRecords.map((point) => `flameRecordsElement: ${point}`).join('\n') : 'flameRecords does not contain any elements');
192
188
  parts.push(`resultCode: ${String(this.resultCode)}`);
193
- parts.push("*** messages:");
194
- parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
195
- parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
196
- parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
189
+ parts.push('*** messages:');
190
+ parts.push(`messages: ${this.messages !== undefined ? this.messages : '(None)'}`);
191
+ parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : '(None)'}`);
192
+ parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : '(None)'}`);
197
193
 
198
- return parts.join("\n");
194
+ return parts.join('\n');
199
195
  }
200
196
  }
201
197
 
@@ -208,12 +204,12 @@ export class PoolFireCalculationResponse extends CalculationResponseBase {
208
204
  *
209
205
  */
210
206
  constructor(data: {
211
- poolFireFlameResult: Entities.PoolFireFlameResult,
212
- flameRecords: Entities.FlameRecord[],
213
- resultCode: Enums.ResultCode,
214
- messages: string[],
215
- calculationElapsedTime: number,
216
- operationId: string
207
+ poolFireFlameResult: Entities.PoolFireFlameResult;
208
+ flameRecords: Entities.FlameRecord[];
209
+ resultCode: Enums.ResultCode;
210
+ messages: string[];
211
+ calculationElapsedTime: number;
212
+ operationId: string;
217
213
  }) {
218
214
  super();
219
215
  this.poolFireFlameResult = data.poolFireFlameResult;
@@ -230,25 +226,23 @@ export class PoolFireCalculationResponse extends CalculationResponseBase {
230
226
  this.poolFireFlameResult.initialiseFromDictionary(data.poolFireFlameResult as { [key: string]: unknown });
231
227
  }
232
228
  if (data.flameRecords && Array.isArray(data.flameRecords)) {
233
- this.flameRecords = data.flameRecords.map(
234
- (item) => {
235
- const record = new Entities.FlameRecord();
236
- record.initialiseFromDictionary(item);
237
- return record;
238
- }
239
- );
229
+ this.flameRecords = data.flameRecords.map((item) => {
230
+ const record = new Entities.FlameRecord();
231
+ record.initialiseFromDictionary(item);
232
+ return record;
233
+ });
240
234
  }
241
- if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
235
+ if (data.resultCode !== undefined && (typeof data.resultCode === 'string' || typeof data.resultCode === 'number')) {
242
236
  this.resultCode = data.resultCode as Enums.ResultCode;
243
237
  }
244
238
  this.messages = this.messages ?? [];
245
239
  if (data.messages && Array.isArray(data.messages)) {
246
240
  this.messages.push(...data.messages);
247
241
  }
248
- if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
242
+ if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === 'number') {
249
243
  this.calculationElapsedTime = data.calculationElapsedTime as number;
250
244
  }
251
- if (data.operationId !== undefined && typeof data.operationId === "string") {
245
+ if (data.operationId !== undefined && typeof data.operationId === 'string') {
252
246
  this.operationId = data.operationId as string;
253
247
  }
254
248
  }
@@ -281,15 +275,15 @@ export class PoolFireCalculationResponseSchema {
281
275
  }).unknown(true);
282
276
 
283
277
  this.propertyTypes = {
284
- poolFireFlameResult: "Entities.PoolFireFlameResult",
285
- flameRecords: "Entities.FlameRecord[]",
278
+ poolFireFlameResult: 'Entities.PoolFireFlameResult',
279
+ flameRecords: 'Entities.FlameRecord[]',
286
280
  };
287
281
  }
288
282
 
289
283
  validate(data: PoolFireCalculationResponseSchemaData): PoolFireCalculationResponse {
290
284
  const { error, value } = this.schema.validate(data, { abortEarly: false });
291
285
  if (error) {
292
- throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
286
+ throw new Error(`Validation error: ${error.details.map((x) => x.message).join(', ')}`);
293
287
  }
294
288
  return this.makeCalculationResponse(value);
295
289
  }
@@ -1,23 +1,23 @@
1
1
  /***********************************************************************
2
- * This file has been auto-generated by a code generation tool.
3
- *
4
- * DO NOT MODIFY THIS FILE
5
- * This file is maintained by DNV.
6
- * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
7
- * Please contact DNV if you believe changes are required.
8
- *
9
- * Version: 1.0.95
10
- * Date/time: 19 Jan 2026 12:11:52
11
- * Template: templates/typescriptpws/calculations.razor.
12
- ***********************************************************************/
13
-
14
- import * as Enums from "../enums";
15
- import * as Entities from "../entities";
16
- import * as EntitySchemas from "../entity-schemas";
17
- import { getAnalyticsApiTarget, getClientAliasId } from "../utilities";
18
- import { CalculationRequestBase, CalculationBase, CalculationResponseBase } from "./calculationBase"
19
-
20
- import Joi from "joi";
2
+ * This file has been auto-generated by a code generation tool.
3
+ *
4
+ * DO NOT MODIFY THIS FILE
5
+ * This file is maintained by DNV.
6
+ * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
7
+ * Please contact DNV if you believe changes are required.
8
+ *
9
+ * Version: 1.0.96
10
+ * Date/time: 4 Apr 2026 08:17:52
11
+ * Template: templates/typescriptpws/calculations.razor.
12
+ ***********************************************************************/
13
+
14
+ import * as Enums from '../enums';
15
+ import * as Entities from '../entities';
16
+ import * as EntitySchemas from '../entity-schemas';
17
+ import { getAnalyticsApiTarget, getClientAliasId } from '../utilities';
18
+ import { CalculationRequestBase, CalculationBase, CalculationResponseBase } from './calculationBase';
19
+
20
+ import Joi from 'joi';
21
21
 
22
22
  export interface FlashCalculationRequestSchemaData {
23
23
  material: Entities.Material;
@@ -32,10 +32,7 @@ class FlashCalculationRequest extends CalculationRequestBase {
32
32
  * Flash calculation request class.
33
33
  *
34
34
  */
35
- constructor(data: {
36
- material: Entities.Material,
37
- materialState: Entities.State
38
- }) {
35
+ constructor(data: { material: Entities.Material; materialState: Entities.State }) {
39
36
  super();
40
37
  this.material = data.material;
41
38
  this.materialState = data.materialState;
@@ -56,15 +53,15 @@ export class FlashCalculationRequestSchema {
56
53
  }).unknown(true);
57
54
 
58
55
  this.propertyTypes = {
59
- material: "Entities.Material",
60
- materialState: "Entities.State",
56
+ material: 'Entities.Material',
57
+ materialState: 'Entities.State',
61
58
  };
62
59
  }
63
60
 
64
61
  validate(data: FlashCalculationRequestSchemaData): FlashCalculationRequest {
65
62
  const { error, value } = this.schema.validate(data, { abortEarly: false });
66
63
  if (error) {
67
- throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
64
+ throw new Error(`Validation error: ${error.details.map((x) => x.message).join(', ')}`);
68
65
  }
69
66
  return this.makeCalculationRequest(value);
70
67
  }
@@ -84,11 +81,7 @@ export class FlashCalculation extends CalculationBase {
84
81
  to obtain the fluid properties.
85
82
  *
86
83
  */
87
- constructor(data: {
88
- material: Entities.Material,
89
- materialState: Entities.State
90
- controller?: AbortController;
91
- }) {
84
+ constructor(data: { material: Entities.Material; materialState: Entities.State; controller?: AbortController }) {
92
85
  super(data.controller);
93
86
  this.material = data.material;
94
87
  this.materialState = data.materialState;
@@ -98,7 +91,7 @@ to obtain the fluid properties.
98
91
  try {
99
92
  const request = new FlashCalculationRequest({
100
93
  material: this.material,
101
- materialState: this.materialState
94
+ materialState: this.materialState,
102
95
  });
103
96
 
104
97
  const schema = new FlashCalculationRequestSchema();
@@ -139,16 +132,16 @@ to obtain the fluid properties.
139
132
  }
140
133
 
141
134
  toString() {
142
- const parts = ["* Flash"];
135
+ const parts = ['* Flash'];
143
136
 
144
137
  parts.push(`flashResult: ${String(this.flashResult)}`);
145
138
  parts.push(`resultCode: ${String(this.resultCode)}`);
146
- parts.push("*** messages:");
147
- parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
148
- parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
149
- parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
139
+ parts.push('*** messages:');
140
+ parts.push(`messages: ${this.messages !== undefined ? this.messages : '(None)'}`);
141
+ parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : '(None)'}`);
142
+ parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : '(None)'}`);
150
143
 
151
- return parts.join("\n");
144
+ return parts.join('\n');
152
145
  }
153
146
  }
154
147
 
@@ -159,13 +152,7 @@ export class FlashCalculationResponse extends CalculationResponseBase {
159
152
  * Flash calculation response class.
160
153
  *
161
154
  */
162
- constructor(data: {
163
- flashResult: Entities.FlashResult,
164
- resultCode: Enums.ResultCode,
165
- messages: string[],
166
- calculationElapsedTime: number,
167
- operationId: string
168
- }) {
155
+ constructor(data: { flashResult: Entities.FlashResult; resultCode: Enums.ResultCode; messages: string[]; calculationElapsedTime: number; operationId: string }) {
169
156
  super();
170
157
  this.flashResult = data.flashResult;
171
158
  this.resultCode = data.resultCode;
@@ -179,17 +166,17 @@ export class FlashCalculationResponse extends CalculationResponseBase {
179
166
  this.flashResult = new Entities.FlashResult();
180
167
  this.flashResult.initialiseFromDictionary(data.flashResult as { [key: string]: unknown });
181
168
  }
182
- if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
169
+ if (data.resultCode !== undefined && (typeof data.resultCode === 'string' || typeof data.resultCode === 'number')) {
183
170
  this.resultCode = data.resultCode as Enums.ResultCode;
184
171
  }
185
172
  this.messages = this.messages ?? [];
186
173
  if (data.messages && Array.isArray(data.messages)) {
187
174
  this.messages.push(...data.messages);
188
175
  }
189
- if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
176
+ if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === 'number') {
190
177
  this.calculationElapsedTime = data.calculationElapsedTime as number;
191
178
  }
192
- if (data.operationId !== undefined && typeof data.operationId === "string") {
179
+ if (data.operationId !== undefined && typeof data.operationId === 'string') {
193
180
  this.operationId = data.operationId as string;
194
181
  }
195
182
  }
@@ -220,14 +207,14 @@ export class FlashCalculationResponseSchema {
220
207
  }).unknown(true);
221
208
 
222
209
  this.propertyTypes = {
223
- flashResult: "Entities.FlashResult",
210
+ flashResult: 'Entities.FlashResult',
224
211
  };
225
212
  }
226
213
 
227
214
  validate(data: FlashCalculationResponseSchemaData): FlashCalculationResponse {
228
215
  const { error, value } = this.schema.validate(data, { abortEarly: false });
229
216
  if (error) {
230
- throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
217
+ throw new Error(`Validation error: ${error.details.map((x) => x.message).join(', ')}`);
231
218
  }
232
219
  return this.makeCalculationResponse(value);
233
220
  }