@dnv-plant/typescriptpws 1.0.77 → 1.0.78

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,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.77
4
- * Date/time: 18 Jun 2025 15:16:48
3
+ * Version: 1.0.78
4
+ * Date/time: 20 Jun 2025 16:35:08
5
5
  * Template: templates/typescriptpws/calculations.razor.
6
6
  ***********************************************************************/
7
7
 
@@ -373,34 +373,31 @@ export class LateExplosionCalculation extends CalculationBase {
373
373
 
374
374
  this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
375
375
 
376
- const response = await this.postRequest(url, requestJson);
377
-
378
- if (response.status >= 200 && response.status < 300) {
379
- const schema = new LateExplosionCalculationResponseSchema();
380
- const validatedResponse = schema.validate(response.data);
381
-
382
- this.resultCode = validatedResponse.resultCode;
383
- if (this.resultCode === Enums.ResultCode.SUCCESS) {
384
- this.explosionUnifConfOverpressureResult = validatedResponse.explosionUnifConfOverpressureResult;
385
- this.explosionUnconfOverpressureResult = validatedResponse.explosionUnconfOverpressureResult;
386
- this.resultCode = validatedResponse.resultCode;
387
- this.messages = validatedResponse.messages ?? [];
388
- this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
389
- this.operationId = validatedResponse.operationId;
390
- } else {
391
- this.messages.push(...(validatedResponse.messages ?? []));
392
- }
376
+ const { data } = await this.postRequest(url, requestJson);
377
+
378
+ const responseSchema = new LateExplosionCalculationResponseSchema();
379
+ const validatedResponse = responseSchema.validate(data);
380
+
381
+ this.resultCode = validatedResponse.resultCode;
382
+ if (this.resultCode === Enums.ResultCode.SUCCESS) {
383
+ Object.assign(this, {
384
+ explosionUnifConfOverpressureResult: validatedResponse.explosionUnifConfOverpressureResult,
385
+ explosionUnconfOverpressureResult: validatedResponse.explosionUnconfOverpressureResult,
386
+ resultCode: validatedResponse.resultCode,
387
+ messages: validatedResponse.messages ?? [],
388
+ calculationElapsedTime: validatedResponse.calculationElapsedTime,
389
+ operationId: validatedResponse.operationId,
390
+ });
393
391
  } else {
394
- this.handleFailedResponse(response);
392
+ this.messages.push(...(validatedResponse.messages ?? []));
395
393
  }
396
- } catch (error) {
397
- if (error instanceof Error) {
398
- this.messages.push(`Error: ${error.message}`);
394
+ } catch (err: any) {
395
+ if ((err as any)?.response) {
396
+ this.handleFailedResponse((err as any).response);
399
397
  } else {
400
- this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
398
+ throw err;
401
399
  }
402
- console.error(error);
403
- this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
400
+ console.error(err);
404
401
  }
405
402
 
406
403
  return this.resultCode;
@@ -764,34 +761,31 @@ export class LateExplosionToOPLevelsCalculation extends CalculationBase {
764
761
 
765
762
  this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
766
763
 
767
- const response = await this.postRequest(url, requestJson);
768
-
769
- if (response.status >= 200 && response.status < 300) {
770
- const schema = new LateExplosionToOPLevelsCalculationResponseSchema();
771
- const validatedResponse = schema.validate(response.data);
772
-
773
- this.resultCode = validatedResponse.resultCode;
774
- if (this.resultCode === Enums.ResultCode.SUCCESS) {
775
- this.explosionUnifConfOverpressureResults = validatedResponse.explosionUnifConfOverpressureResults;
776
- this.explosionUnconfOverpressureResults = validatedResponse.explosionUnconfOverpressureResults;
777
- this.resultCode = validatedResponse.resultCode;
778
- this.messages = validatedResponse.messages ?? [];
779
- this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
780
- this.operationId = validatedResponse.operationId;
781
- } else {
782
- this.messages.push(...(validatedResponse.messages ?? []));
783
- }
764
+ const { data } = await this.postRequest(url, requestJson);
765
+
766
+ const responseSchema = new LateExplosionToOPLevelsCalculationResponseSchema();
767
+ const validatedResponse = responseSchema.validate(data);
768
+
769
+ this.resultCode = validatedResponse.resultCode;
770
+ if (this.resultCode === Enums.ResultCode.SUCCESS) {
771
+ Object.assign(this, {
772
+ explosionUnifConfOverpressureResults: validatedResponse.explosionUnifConfOverpressureResults,
773
+ explosionUnconfOverpressureResults: validatedResponse.explosionUnconfOverpressureResults,
774
+ resultCode: validatedResponse.resultCode,
775
+ messages: validatedResponse.messages ?? [],
776
+ calculationElapsedTime: validatedResponse.calculationElapsedTime,
777
+ operationId: validatedResponse.operationId,
778
+ });
784
779
  } else {
785
- this.handleFailedResponse(response);
780
+ this.messages.push(...(validatedResponse.messages ?? []));
786
781
  }
787
- } catch (error) {
788
- if (error instanceof Error) {
789
- this.messages.push(`Error: ${error.message}`);
782
+ } catch (err: any) {
783
+ if ((err as any)?.response) {
784
+ this.handleFailedResponse((err as any).response);
790
785
  } else {
791
- this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
786
+ throw err;
792
787
  }
793
- console.error(error);
794
- this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
788
+ console.error(err);
795
789
  }
796
790
 
797
791
  return this.resultCode;
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.77
4
- * Date/time: 18 Jun 2025 15:16:48
3
+ * Version: 1.0.78
4
+ * Date/time: 20 Jun 2025 16:35:08
5
5
  * Template: templates/typescriptpws/calculations.razor.
6
6
  ***********************************************************************/
7
7
 
@@ -535,53 +535,50 @@ export class UserDefinedSourceLinkedRunCalculation extends CalculationBase {
535
535
 
536
536
  this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
537
537
 
538
- const response = await this.postRequest(url, requestJson);
539
-
540
- if (response.status >= 200 && response.status < 300) {
541
- const schema = new UserDefinedSourceLinkedRunCalculationResponseSchema();
542
- const validatedResponse = schema.validate(response.data);
543
-
544
- this.resultCode = validatedResponse.resultCode;
545
- if (this.resultCode === Enums.ResultCode.SUCCESS) {
546
- this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
547
- this.jetContourPoints = validatedResponse.jetContourPoints;
548
- this.nJetContourPoints = validatedResponse.nJetContourPoints;
549
- this.areaContourJet = validatedResponse.areaContourJet;
550
- this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
551
- this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
552
- this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
553
- this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
554
- this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
555
- this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
556
- this.poolContourPoints = validatedResponse.poolContourPoints;
557
- this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
558
- this.areaContourPool = validatedResponse.areaContourPool;
559
- this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
560
- this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
561
- this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
562
- this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
563
- this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
564
- this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
565
- this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
566
- this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
567
- this.resultCode = validatedResponse.resultCode;
568
- this.messages = validatedResponse.messages ?? [];
569
- this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
570
- this.operationId = validatedResponse.operationId;
571
- } else {
572
- this.messages.push(...(validatedResponse.messages ?? []));
573
- }
538
+ const { data } = await this.postRequest(url, requestJson);
539
+
540
+ const responseSchema = new UserDefinedSourceLinkedRunCalculationResponseSchema();
541
+ const validatedResponse = responseSchema.validate(data);
542
+
543
+ this.resultCode = validatedResponse.resultCode;
544
+ if (this.resultCode === Enums.ResultCode.SUCCESS) {
545
+ Object.assign(this, {
546
+ distancesToJetFireRadiation: validatedResponse.distancesToJetFireRadiation,
547
+ jetContourPoints: validatedResponse.jetContourPoints,
548
+ nJetContourPoints: validatedResponse.nJetContourPoints,
549
+ areaContourJet: validatedResponse.areaContourJet,
550
+ distancesToFlamConcentration: validatedResponse.distancesToFlamConcentration,
551
+ flamConcentrationsUsed: validatedResponse.flamConcentrationsUsed,
552
+ flamConcContourPoints: validatedResponse.flamConcContourPoints,
553
+ nFlamConcContourPoints: validatedResponse.nFlamConcContourPoints,
554
+ areaFootprintFlamConc: validatedResponse.areaFootprintFlamConc,
555
+ distancesToPoolFireRadiation: validatedResponse.distancesToPoolFireRadiation,
556
+ poolContourPoints: validatedResponse.poolContourPoints,
557
+ nPoolContourPoints: validatedResponse.nPoolContourPoints,
558
+ areaContourPool: validatedResponse.areaContourPool,
559
+ explosionOverpressureResults: validatedResponse.explosionOverpressureResults,
560
+ distancesToToxicConcentration: validatedResponse.distancesToToxicConcentration,
561
+ toxicConcentrationUsed: validatedResponse.toxicConcentrationUsed,
562
+ toxicConcContourPoints: validatedResponse.toxicConcContourPoints,
563
+ nToxicConcContourPoints: validatedResponse.nToxicConcContourPoints,
564
+ areaFootprintToxicConc: validatedResponse.areaFootprintToxicConc,
565
+ jetFireFlameResult: validatedResponse.jetFireFlameResult,
566
+ poolFireFlameResult: validatedResponse.poolFireFlameResult,
567
+ resultCode: validatedResponse.resultCode,
568
+ messages: validatedResponse.messages ?? [],
569
+ calculationElapsedTime: validatedResponse.calculationElapsedTime,
570
+ operationId: validatedResponse.operationId,
571
+ });
574
572
  } else {
575
- this.handleFailedResponse(response);
573
+ this.messages.push(...(validatedResponse.messages ?? []));
576
574
  }
577
- } catch (error) {
578
- if (error instanceof Error) {
579
- this.messages.push(`Error: ${error.message}`);
575
+ } catch (err: any) {
576
+ if ((err as any)?.response) {
577
+ this.handleFailedResponse((err as any).response);
580
578
  } else {
581
- this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
579
+ throw err;
582
580
  }
583
- console.error(error);
584
- this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
581
+ console.error(err);
585
582
  }
586
583
 
587
584
  return this.resultCode;
@@ -1409,54 +1406,51 @@ export class VesselLeakLinkedRunCalculation extends CalculationBase {
1409
1406
 
1410
1407
  this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
1411
1408
 
1412
- const response = await this.postRequest(url, requestJson);
1413
-
1414
- if (response.status >= 200 && response.status < 300) {
1415
- const schema = new VesselLeakLinkedRunCalculationResponseSchema();
1416
- const validatedResponse = schema.validate(response.data);
1417
-
1418
- this.resultCode = validatedResponse.resultCode;
1419
- if (this.resultCode === Enums.ResultCode.SUCCESS) {
1420
- this.dischargeRecord = validatedResponse.dischargeRecord;
1421
- this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
1422
- this.jetContourPoints = validatedResponse.jetContourPoints;
1423
- this.nJetContourPoints = validatedResponse.nJetContourPoints;
1424
- this.areaContourJet = validatedResponse.areaContourJet;
1425
- this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
1426
- this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
1427
- this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
1428
- this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
1429
- this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
1430
- this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
1431
- this.poolContourPoints = validatedResponse.poolContourPoints;
1432
- this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
1433
- this.areaContourPool = validatedResponse.areaContourPool;
1434
- this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
1435
- this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
1436
- this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
1437
- this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
1438
- this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
1439
- this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
1440
- this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
1441
- this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
1442
- this.resultCode = validatedResponse.resultCode;
1443
- this.messages = validatedResponse.messages ?? [];
1444
- this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
1445
- this.operationId = validatedResponse.operationId;
1446
- } else {
1447
- this.messages.push(...(validatedResponse.messages ?? []));
1448
- }
1409
+ const { data } = await this.postRequest(url, requestJson);
1410
+
1411
+ const responseSchema = new VesselLeakLinkedRunCalculationResponseSchema();
1412
+ const validatedResponse = responseSchema.validate(data);
1413
+
1414
+ this.resultCode = validatedResponse.resultCode;
1415
+ if (this.resultCode === Enums.ResultCode.SUCCESS) {
1416
+ Object.assign(this, {
1417
+ dischargeRecord: validatedResponse.dischargeRecord,
1418
+ distancesToJetFireRadiation: validatedResponse.distancesToJetFireRadiation,
1419
+ jetContourPoints: validatedResponse.jetContourPoints,
1420
+ nJetContourPoints: validatedResponse.nJetContourPoints,
1421
+ areaContourJet: validatedResponse.areaContourJet,
1422
+ distancesToFlamConcentration: validatedResponse.distancesToFlamConcentration,
1423
+ flamConcentrationsUsed: validatedResponse.flamConcentrationsUsed,
1424
+ flamConcContourPoints: validatedResponse.flamConcContourPoints,
1425
+ nFlamConcContourPoints: validatedResponse.nFlamConcContourPoints,
1426
+ areaFootprintFlamConc: validatedResponse.areaFootprintFlamConc,
1427
+ distancesToPoolFireRadiation: validatedResponse.distancesToPoolFireRadiation,
1428
+ poolContourPoints: validatedResponse.poolContourPoints,
1429
+ nPoolContourPoints: validatedResponse.nPoolContourPoints,
1430
+ areaContourPool: validatedResponse.areaContourPool,
1431
+ explosionOverpressureResults: validatedResponse.explosionOverpressureResults,
1432
+ distancesToToxicConcentration: validatedResponse.distancesToToxicConcentration,
1433
+ toxicConcentrationUsed: validatedResponse.toxicConcentrationUsed,
1434
+ toxicConcContourPoints: validatedResponse.toxicConcContourPoints,
1435
+ nToxicConcContourPoints: validatedResponse.nToxicConcContourPoints,
1436
+ areaFootprintToxicConc: validatedResponse.areaFootprintToxicConc,
1437
+ jetFireFlameResult: validatedResponse.jetFireFlameResult,
1438
+ poolFireFlameResult: validatedResponse.poolFireFlameResult,
1439
+ resultCode: validatedResponse.resultCode,
1440
+ messages: validatedResponse.messages ?? [],
1441
+ calculationElapsedTime: validatedResponse.calculationElapsedTime,
1442
+ operationId: validatedResponse.operationId,
1443
+ });
1449
1444
  } else {
1450
- this.handleFailedResponse(response);
1445
+ this.messages.push(...(validatedResponse.messages ?? []));
1451
1446
  }
1452
- } catch (error) {
1453
- if (error instanceof Error) {
1454
- this.messages.push(`Error: ${error.message}`);
1447
+ } catch (err: any) {
1448
+ if ((err as any)?.response) {
1449
+ this.handleFailedResponse((err as any).response);
1455
1450
  } else {
1456
- this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
1451
+ throw err;
1457
1452
  }
1458
- console.error(error);
1459
- this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
1453
+ console.error(err);
1460
1454
  }
1461
1455
 
1462
1456
  return this.resultCode;
@@ -2297,54 +2291,51 @@ export class VesselLineRuptureLinkedRunCalculation extends CalculationBase {
2297
2291
 
2298
2292
  this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
2299
2293
 
2300
- const response = await this.postRequest(url, requestJson);
2301
-
2302
- if (response.status >= 200 && response.status < 300) {
2303
- const schema = new VesselLineRuptureLinkedRunCalculationResponseSchema();
2304
- const validatedResponse = schema.validate(response.data);
2305
-
2306
- this.resultCode = validatedResponse.resultCode;
2307
- if (this.resultCode === Enums.ResultCode.SUCCESS) {
2308
- this.dischargeRecord = validatedResponse.dischargeRecord;
2309
- this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
2310
- this.jetContourPoints = validatedResponse.jetContourPoints;
2311
- this.nJetContourPoints = validatedResponse.nJetContourPoints;
2312
- this.areaContourJet = validatedResponse.areaContourJet;
2313
- this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
2314
- this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
2315
- this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
2316
- this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
2317
- this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
2318
- this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
2319
- this.poolContourPoints = validatedResponse.poolContourPoints;
2320
- this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
2321
- this.areaContourPool = validatedResponse.areaContourPool;
2322
- this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
2323
- this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
2324
- this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
2325
- this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
2326
- this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
2327
- this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
2328
- this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
2329
- this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
2330
- this.resultCode = validatedResponse.resultCode;
2331
- this.messages = validatedResponse.messages ?? [];
2332
- this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
2333
- this.operationId = validatedResponse.operationId;
2334
- } else {
2335
- this.messages.push(...(validatedResponse.messages ?? []));
2336
- }
2294
+ const { data } = await this.postRequest(url, requestJson);
2295
+
2296
+ const responseSchema = new VesselLineRuptureLinkedRunCalculationResponseSchema();
2297
+ const validatedResponse = responseSchema.validate(data);
2298
+
2299
+ this.resultCode = validatedResponse.resultCode;
2300
+ if (this.resultCode === Enums.ResultCode.SUCCESS) {
2301
+ Object.assign(this, {
2302
+ dischargeRecord: validatedResponse.dischargeRecord,
2303
+ distancesToJetFireRadiation: validatedResponse.distancesToJetFireRadiation,
2304
+ jetContourPoints: validatedResponse.jetContourPoints,
2305
+ nJetContourPoints: validatedResponse.nJetContourPoints,
2306
+ areaContourJet: validatedResponse.areaContourJet,
2307
+ distancesToFlamConcentration: validatedResponse.distancesToFlamConcentration,
2308
+ flamConcentrationsUsed: validatedResponse.flamConcentrationsUsed,
2309
+ flamConcContourPoints: validatedResponse.flamConcContourPoints,
2310
+ nFlamConcContourPoints: validatedResponse.nFlamConcContourPoints,
2311
+ areaFootprintFlamConc: validatedResponse.areaFootprintFlamConc,
2312
+ distancesToPoolFireRadiation: validatedResponse.distancesToPoolFireRadiation,
2313
+ poolContourPoints: validatedResponse.poolContourPoints,
2314
+ nPoolContourPoints: validatedResponse.nPoolContourPoints,
2315
+ areaContourPool: validatedResponse.areaContourPool,
2316
+ explosionOverpressureResults: validatedResponse.explosionOverpressureResults,
2317
+ distancesToToxicConcentration: validatedResponse.distancesToToxicConcentration,
2318
+ toxicConcentrationUsed: validatedResponse.toxicConcentrationUsed,
2319
+ toxicConcContourPoints: validatedResponse.toxicConcContourPoints,
2320
+ nToxicConcContourPoints: validatedResponse.nToxicConcContourPoints,
2321
+ areaFootprintToxicConc: validatedResponse.areaFootprintToxicConc,
2322
+ jetFireFlameResult: validatedResponse.jetFireFlameResult,
2323
+ poolFireFlameResult: validatedResponse.poolFireFlameResult,
2324
+ resultCode: validatedResponse.resultCode,
2325
+ messages: validatedResponse.messages ?? [],
2326
+ calculationElapsedTime: validatedResponse.calculationElapsedTime,
2327
+ operationId: validatedResponse.operationId,
2328
+ });
2337
2329
  } else {
2338
- this.handleFailedResponse(response);
2330
+ this.messages.push(...(validatedResponse.messages ?? []));
2339
2331
  }
2340
- } catch (error) {
2341
- if (error instanceof Error) {
2342
- this.messages.push(`Error: ${error.message}`);
2332
+ } catch (err: any) {
2333
+ if ((err as any)?.response) {
2334
+ this.handleFailedResponse((err as any).response);
2343
2335
  } else {
2344
- this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
2336
+ throw err;
2345
2337
  }
2346
- console.error(error);
2347
- this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
2338
+ console.error(err);
2348
2339
  }
2349
2340
 
2350
2341
  return this.resultCode;
@@ -3185,54 +3176,51 @@ export class VesselReliefValveLinkedRunCalculation extends CalculationBase {
3185
3176
 
3186
3177
  this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
3187
3178
 
3188
- const response = await this.postRequest(url, requestJson);
3189
-
3190
- if (response.status >= 200 && response.status < 300) {
3191
- const schema = new VesselReliefValveLinkedRunCalculationResponseSchema();
3192
- const validatedResponse = schema.validate(response.data);
3193
-
3194
- this.resultCode = validatedResponse.resultCode;
3195
- if (this.resultCode === Enums.ResultCode.SUCCESS) {
3196
- this.dischargeRecord = validatedResponse.dischargeRecord;
3197
- this.distancesToJetFireRadiation = validatedResponse.distancesToJetFireRadiation;
3198
- this.jetContourPoints = validatedResponse.jetContourPoints;
3199
- this.nJetContourPoints = validatedResponse.nJetContourPoints;
3200
- this.areaContourJet = validatedResponse.areaContourJet;
3201
- this.distancesToFlamConcentration = validatedResponse.distancesToFlamConcentration;
3202
- this.flamConcentrationsUsed = validatedResponse.flamConcentrationsUsed;
3203
- this.flamConcContourPoints = validatedResponse.flamConcContourPoints;
3204
- this.nFlamConcContourPoints = validatedResponse.nFlamConcContourPoints;
3205
- this.areaFootprintFlamConc = validatedResponse.areaFootprintFlamConc;
3206
- this.distancesToPoolFireRadiation = validatedResponse.distancesToPoolFireRadiation;
3207
- this.poolContourPoints = validatedResponse.poolContourPoints;
3208
- this.nPoolContourPoints = validatedResponse.nPoolContourPoints;
3209
- this.areaContourPool = validatedResponse.areaContourPool;
3210
- this.explosionOverpressureResults = validatedResponse.explosionOverpressureResults;
3211
- this.distancesToToxicConcentration = validatedResponse.distancesToToxicConcentration;
3212
- this.toxicConcentrationUsed = validatedResponse.toxicConcentrationUsed;
3213
- this.toxicConcContourPoints = validatedResponse.toxicConcContourPoints;
3214
- this.nToxicConcContourPoints = validatedResponse.nToxicConcContourPoints;
3215
- this.areaFootprintToxicConc = validatedResponse.areaFootprintToxicConc;
3216
- this.jetFireFlameResult = validatedResponse.jetFireFlameResult;
3217
- this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
3218
- this.resultCode = validatedResponse.resultCode;
3219
- this.messages = validatedResponse.messages ?? [];
3220
- this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
3221
- this.operationId = validatedResponse.operationId;
3222
- } else {
3223
- this.messages.push(...(validatedResponse.messages ?? []));
3224
- }
3179
+ const { data } = await this.postRequest(url, requestJson);
3180
+
3181
+ const responseSchema = new VesselReliefValveLinkedRunCalculationResponseSchema();
3182
+ const validatedResponse = responseSchema.validate(data);
3183
+
3184
+ this.resultCode = validatedResponse.resultCode;
3185
+ if (this.resultCode === Enums.ResultCode.SUCCESS) {
3186
+ Object.assign(this, {
3187
+ dischargeRecord: validatedResponse.dischargeRecord,
3188
+ distancesToJetFireRadiation: validatedResponse.distancesToJetFireRadiation,
3189
+ jetContourPoints: validatedResponse.jetContourPoints,
3190
+ nJetContourPoints: validatedResponse.nJetContourPoints,
3191
+ areaContourJet: validatedResponse.areaContourJet,
3192
+ distancesToFlamConcentration: validatedResponse.distancesToFlamConcentration,
3193
+ flamConcentrationsUsed: validatedResponse.flamConcentrationsUsed,
3194
+ flamConcContourPoints: validatedResponse.flamConcContourPoints,
3195
+ nFlamConcContourPoints: validatedResponse.nFlamConcContourPoints,
3196
+ areaFootprintFlamConc: validatedResponse.areaFootprintFlamConc,
3197
+ distancesToPoolFireRadiation: validatedResponse.distancesToPoolFireRadiation,
3198
+ poolContourPoints: validatedResponse.poolContourPoints,
3199
+ nPoolContourPoints: validatedResponse.nPoolContourPoints,
3200
+ areaContourPool: validatedResponse.areaContourPool,
3201
+ explosionOverpressureResults: validatedResponse.explosionOverpressureResults,
3202
+ distancesToToxicConcentration: validatedResponse.distancesToToxicConcentration,
3203
+ toxicConcentrationUsed: validatedResponse.toxicConcentrationUsed,
3204
+ toxicConcContourPoints: validatedResponse.toxicConcContourPoints,
3205
+ nToxicConcContourPoints: validatedResponse.nToxicConcContourPoints,
3206
+ areaFootprintToxicConc: validatedResponse.areaFootprintToxicConc,
3207
+ jetFireFlameResult: validatedResponse.jetFireFlameResult,
3208
+ poolFireFlameResult: validatedResponse.poolFireFlameResult,
3209
+ resultCode: validatedResponse.resultCode,
3210
+ messages: validatedResponse.messages ?? [],
3211
+ calculationElapsedTime: validatedResponse.calculationElapsedTime,
3212
+ operationId: validatedResponse.operationId,
3213
+ });
3225
3214
  } else {
3226
- this.handleFailedResponse(response);
3215
+ this.messages.push(...(validatedResponse.messages ?? []));
3227
3216
  }
3228
- } catch (error) {
3229
- if (error instanceof Error) {
3230
- this.messages.push(`Error: ${error.message}`);
3217
+ } catch (err: any) {
3218
+ if ((err as any)?.response) {
3219
+ this.handleFailedResponse((err as any).response);
3231
3220
  } else {
3232
- this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
3221
+ throw err;
3233
3222
  }
3234
- console.error(error);
3235
- this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
3223
+ console.error(err);
3236
3224
  }
3237
3225
 
3238
3226
  return this.resultCode;
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.77
4
- * Date/time: 18 Jun 2025 15:16:48
3
+ * Version: 1.0.78
4
+ * Date/time: 20 Jun 2025 16:35:08
5
5
  * Template: templates/typescriptpws/calculations.razor.
6
6
  ***********************************************************************/
7
7
 
@@ -295,34 +295,31 @@ export class PoolFireCalculation extends CalculationBase {
295
295
 
296
296
  this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
297
297
 
298
- const response = await this.postRequest(url, requestJson);
299
-
300
- if (response.status >= 200 && response.status < 300) {
301
- const schema = new PoolFireCalculationResponseSchema();
302
- const validatedResponse = schema.validate(response.data);
303
-
304
- this.resultCode = validatedResponse.resultCode;
305
- if (this.resultCode === Enums.ResultCode.SUCCESS) {
306
- this.poolFireFlameResult = validatedResponse.poolFireFlameResult;
307
- this.flameRecords = validatedResponse.flameRecords;
308
- this.resultCode = validatedResponse.resultCode;
309
- this.messages = validatedResponse.messages ?? [];
310
- this.calculationElapsedTime = validatedResponse.calculationElapsedTime;
311
- this.operationId = validatedResponse.operationId;
312
- } else {
313
- this.messages.push(...(validatedResponse.messages ?? []));
314
- }
298
+ const { data } = await this.postRequest(url, requestJson);
299
+
300
+ const responseSchema = new PoolFireCalculationResponseSchema();
301
+ const validatedResponse = responseSchema.validate(data);
302
+
303
+ this.resultCode = validatedResponse.resultCode;
304
+ if (this.resultCode === Enums.ResultCode.SUCCESS) {
305
+ Object.assign(this, {
306
+ poolFireFlameResult: validatedResponse.poolFireFlameResult,
307
+ flameRecords: validatedResponse.flameRecords,
308
+ resultCode: validatedResponse.resultCode,
309
+ messages: validatedResponse.messages ?? [],
310
+ calculationElapsedTime: validatedResponse.calculationElapsedTime,
311
+ operationId: validatedResponse.operationId,
312
+ });
315
313
  } else {
316
- this.handleFailedResponse(response);
314
+ this.messages.push(...(validatedResponse.messages ?? []));
317
315
  }
318
- } catch (error) {
319
- if (error instanceof Error) {
320
- this.messages.push(`Error: ${error.message}`);
316
+ } catch (err: any) {
317
+ if ((err as any)?.response) {
318
+ this.handleFailedResponse((err as any).response);
321
319
  } else {
322
- this.messages.push(`Unexpected error: ${JSON.stringify(error)}`);
320
+ throw err;
323
321
  }
324
- console.error(error);
325
- this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
322
+ console.error(err);
326
323
  }
327
324
 
328
325
  return this.resultCode;