@dnv-plant/typescriptpws 1.0.25 → 1.0.26-alpha.1838115

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.
package/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.25
4
- * Date/time: 25 Feb 2025 23:06:04
3
+ * Version: 1.0.26
4
+ * Date/time: 17 Mar 2025 16:56:37
5
5
  * Template: templates/typescriptpws/index.razor.
6
6
  ***********************************************************************/
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnv-plant/typescriptpws",
3
- "version": "1.0.25",
3
+ "version": "1.0.26-alpha.1838115",
4
4
  "description": "Integrate Phast models with our versatile APIs for enhanced customization and efficiency.",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -18,4 +18,4 @@
18
18
  "devDependencies": {
19
19
  "@types/jsonwebtoken": "^9.0.8"
20
20
  }
21
- }
21
+ }
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.25
4
- * Date/time: 25 Feb 2025 23:06:04
3
+ * Version: 1.0.26
4
+ * Date/time: 17 Mar 2025 16:56:37
5
5
  * Template: templates/typescriptpws/calculations.razor.
6
6
  ***********************************************************************/
7
7
 
package/src/constants.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.25
4
- * Date/time: 25 Feb 2025 23:06:02
3
+ * Version: 1.0.26
4
+ * Date/time: 17 Mar 2025 16:56:35
5
5
  * Template: templates/typescriptpws/constants.razor.
6
6
  ***********************************************************************/
7
7
 
@@ -299,7 +299,7 @@ export const USER_INPUT_POST_EXPANSION_VELOCITY = 0;
299
299
  export const WIND_CUTOFF_HEIGHT = 1.0;
300
300
  // Cut-off height for wind speed calculations.
301
301
 
302
- export const WIND_PROFILE_FLAG = 2;
302
+ export const WIND_PROFILE_FLAG = 4;
303
303
  // Logarithmic wind profile.
304
304
 
305
305
  export const PWS_CLIENT_ID = "eeca6885-127e-4405-aa1f-3a8e69acc451";
package/src/entities.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.25
4
- * Date/time: 25 Feb 2025 23:06:03
3
+ * Version: 1.0.26
4
+ * Date/time: 17 Mar 2025 16:56:36
5
5
  * Template: templates/typescriptpws/entities.razor.
6
6
  ***********************************************************************/
7
7
 
@@ -3160,6 +3160,82 @@ export class ReliefValve extends ReleaseOverTime {
3160
3160
  }
3161
3161
  }
3162
3162
 
3163
+ export class SafetySystem extends EntityBase {
3164
+ isolationTime: number;
3165
+ isolationSuccess: boolean;
3166
+ massAddedIsolationFailure: number;
3167
+ blowdownTime: number;
3168
+ blowdownSuccess: boolean;
3169
+ blowdownValveSize: number;
3170
+
3171
+ /**
3172
+ * A safety system entity which defines isolation and blowdown settings for a pressurised vessel.
3173
+ *
3174
+ * @param {number} isolationTime - Time from start of release to failed or successful isolation. (default value is 0.0)
3175
+ * @param {boolean} isolationSuccess - Does isolation succeed?. (default value is true)
3176
+ * @param {number} massAddedIsolationFailure - Upstream mass to add in case of isolation failure. (default value is 0.0)
3177
+ * @param {number} blowdownTime - Time from start of release to failed or successful blowdown. (default value is 0.0)
3178
+ * @param {boolean} blowdownSuccess - Does blowdown succeed?. (default value is false)
3179
+ * @param {number} blowdownValveSize - Diameter of blowdown valve. (default value is 0.025)
3180
+ */
3181
+ constructor(
3182
+ id?: string,
3183
+ typeId?: string,
3184
+ displayName?: string,
3185
+ isolationTime: number = 0.0,
3186
+ isolationSuccess: boolean = true,
3187
+ massAddedIsolationFailure: number = 0.0,
3188
+ blowdownTime: number = 0.0,
3189
+ blowdownSuccess: boolean = false,
3190
+ blowdownValveSize: number = 0.025
3191
+ ) {
3192
+ super(id, typeId, displayName);
3193
+ this.isolationTime = isolationTime;
3194
+ this.isolationSuccess = isolationSuccess;
3195
+ this.massAddedIsolationFailure = massAddedIsolationFailure;
3196
+ this.blowdownTime = blowdownTime;
3197
+ this.blowdownSuccess = blowdownSuccess;
3198
+ this.blowdownValveSize = blowdownValveSize;
3199
+ }
3200
+
3201
+ /** Initialise the entity with data from a dictionary. */
3202
+ initialiseFromDictionary(data: { [key: string]: unknown }) {
3203
+ super.initialiseFromDictionary(data);
3204
+ if (data.isolationTime !== undefined && typeof data.isolationTime === "number") {
3205
+ this.isolationTime = data.isolationTime as number;
3206
+ }
3207
+ if (data.isolationSuccess !== undefined && typeof data.isolationSuccess === "boolean") {
3208
+ this.isolationSuccess = data.isolationSuccess as boolean;
3209
+ }
3210
+ if (data.massAddedIsolationFailure !== undefined && typeof data.massAddedIsolationFailure === "number") {
3211
+ this.massAddedIsolationFailure = data.massAddedIsolationFailure as number;
3212
+ }
3213
+ if (data.blowdownTime !== undefined && typeof data.blowdownTime === "number") {
3214
+ this.blowdownTime = data.blowdownTime as number;
3215
+ }
3216
+ if (data.blowdownSuccess !== undefined && typeof data.blowdownSuccess === "boolean") {
3217
+ this.blowdownSuccess = data.blowdownSuccess as boolean;
3218
+ }
3219
+ if (data.blowdownValveSize !== undefined && typeof data.blowdownValveSize === "number") {
3220
+ this.blowdownValveSize = data.blowdownValveSize as number;
3221
+ }
3222
+ }
3223
+
3224
+ toString() {
3225
+ const parts = [
3226
+ super.toString(),
3227
+ "* SafetySystem",
3228
+ `isolationTime: ${this.isolationTime}`,
3229
+ `isolationSuccess: ${this.isolationSuccess}`,
3230
+ `massAddedIsolationFailure: ${this.massAddedIsolationFailure}`,
3231
+ `blowdownTime: ${this.blowdownTime}`,
3232
+ `blowdownSuccess: ${this.blowdownSuccess}`,
3233
+ `blowdownValveSize: ${this.blowdownValveSize}`,
3234
+ ];
3235
+ return parts.join("\n");
3236
+ }
3237
+ }
3238
+
3163
3239
  export class ScalarUdmOutputs extends EntityBase {
3164
3240
  observerCount?: number;
3165
3241
  recordCount?: number;
@@ -3500,6 +3576,7 @@ export class ToxicRecord extends EntityBase {
3500
3576
  export class Vessel extends Asset {
3501
3577
  state: State;
3502
3578
  material: Material;
3579
+ safetySystem: SafetySystem;
3503
3580
  diameter: number;
3504
3581
  height: number;
3505
3582
  length: number;
@@ -3514,6 +3591,7 @@ export class Vessel extends Asset {
3514
3591
  * @param {LocalPosition} location - Location of the asset.
3515
3592
  * @param {State} state - Fluid state in the vessel.
3516
3593
  * @param {Material} material - Material in the vessel.
3594
+ * @param {SafetySystem} safetySystem - A safety system entity which defines isolation and blowdown settings for a pressurised vessel.
3517
3595
  * @param {number} diameter - Internal diameter of the vessel. (default value is 2)
3518
3596
  * @param {number} height - Internal height of a VerticalCylinder or VesselCuboid. (default value is 4)
3519
3597
  * @param {number} length - Internal length of HorizontalCylinder or VesselCuboid. (default value is 4)
@@ -3529,6 +3607,7 @@ export class Vessel extends Asset {
3529
3607
  location: LocalPosition = new LocalPosition(),
3530
3608
  state: State = new State(),
3531
3609
  material: Material = new Material(),
3610
+ safetySystem: SafetySystem = new SafetySystem(),
3532
3611
  diameter: number = 2,
3533
3612
  height: number = 4,
3534
3613
  length: number = 4,
@@ -3540,6 +3619,7 @@ export class Vessel extends Asset {
3540
3619
  super(id, typeId, displayName, location);
3541
3620
  this.state = state;
3542
3621
  this.material = material;
3622
+ this.safetySystem = safetySystem;
3543
3623
  this.diameter = diameter;
3544
3624
  this.height = height;
3545
3625
  this.length = length;
@@ -3560,6 +3640,10 @@ export class Vessel extends Asset {
3560
3640
  this.material = new Material();
3561
3641
  this.material.initialiseFromDictionary(data.material as { [key: string]: unknown });
3562
3642
  }
3643
+ if (data.safetySystem) {
3644
+ this.safetySystem = new SafetySystem();
3645
+ this.safetySystem.initialiseFromDictionary(data.safetySystem as { [key: string]: unknown });
3646
+ }
3563
3647
  if (data.diameter !== undefined && typeof data.diameter === "number") {
3564
3648
  this.diameter = data.diameter as number;
3565
3649
  }
@@ -3599,6 +3683,7 @@ export class Vessel extends Asset {
3599
3683
  `location: ${this.location?.toString()}`,
3600
3684
  `state: ${this.state?.toString()}`,
3601
3685
  `material: ${this.material?.toString()}`,
3686
+ `safetySystem: ${this.safetySystem?.toString()}`,
3602
3687
  `diameter: ${this.diameter}`,
3603
3688
  `height: ${this.height}`,
3604
3689
  `length: ${this.length}`,
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.25
4
- * Date/time: 25 Feb 2025 23:06:03
3
+ * Version: 1.0.26
4
+ * Date/time: 17 Mar 2025 16:56:36
5
5
  * Template: templates/typescriptpws/entityschemas.razor.
6
6
  ***********************************************************************/
7
7
 
@@ -2479,6 +2479,66 @@ export class ReliefValveSchema extends SchemaBase<ReliefValveSchemaData> {
2479
2479
  }
2480
2480
  }
2481
2481
 
2482
+ export interface SafetySystemSchemaData extends SchemaBaseData {
2483
+ isolationTime: number;
2484
+ isolationSuccess: boolean;
2485
+ massAddedIsolationFailure: number;
2486
+ blowdownTime: number;
2487
+ blowdownSuccess: boolean;
2488
+ blowdownValveSize: number;
2489
+ }
2490
+
2491
+ /**
2492
+ * ================================================================================
2493
+ * Class: SafetySystemSchema
2494
+ * Description: A safety system entity which defines isolation and blowdown settings for a pressurised vessel.
2495
+ * ================================================================================
2496
+ */
2497
+ export class SafetySystemSchema extends SchemaBase<SafetySystemSchemaData> {
2498
+ constructor() {
2499
+ super();
2500
+ this.schema = this.schema.concat(
2501
+ Joi.object({
2502
+ isolationTime: Joi.number().unsafe(),
2503
+ isolationSuccess: Joi.boolean(),
2504
+ massAddedIsolationFailure: Joi.number().unsafe(),
2505
+ blowdownTime: Joi.number().unsafe(),
2506
+ blowdownSuccess: Joi.boolean(),
2507
+ blowdownValveSize: Joi.number().unsafe(),
2508
+ })
2509
+ )
2510
+ .pattern(
2511
+ ignoredPropertiesRegex,
2512
+ Joi.alternatives().try(Joi.string(), Joi.number(), Joi.date(), Joi.any())
2513
+ )
2514
+ .unknown(false);
2515
+
2516
+ this.propertyTypes = {
2517
+ ...this.propertyTypes,
2518
+ isolationTime: "number",
2519
+ isolationSuccess: "boolean",
2520
+ massAddedIsolationFailure: "number",
2521
+ blowdownTime: "number",
2522
+ blowdownSuccess: "boolean",
2523
+ blowdownValveSize: "number",
2524
+ };
2525
+ }
2526
+
2527
+ makeEntity(data: SafetySystemSchemaData): Entities.SafetySystem {
2528
+ return new Entities.SafetySystem(
2529
+ data.id,
2530
+ data.typeId,
2531
+ data.displayName,
2532
+ data.isolationTime,
2533
+ data.isolationSuccess,
2534
+ data.massAddedIsolationFailure,
2535
+ data.blowdownTime,
2536
+ data.blowdownSuccess,
2537
+ data.blowdownValveSize
2538
+ );
2539
+ }
2540
+ }
2541
+
2482
2542
  export interface ScalarUdmOutputsSchemaData extends SchemaBaseData {
2483
2543
  observerCount: number;
2484
2544
  recordCount: number;
@@ -2751,6 +2811,7 @@ export interface VesselSchemaData extends SchemaBaseData {
2751
2811
  location: Entities.LocalPosition;
2752
2812
  state: Entities.State;
2753
2813
  material: Entities.Material;
2814
+ safetySystem: Entities.SafetySystem;
2754
2815
  diameter: number;
2755
2816
  height: number;
2756
2817
  length: number;
@@ -2774,6 +2835,7 @@ export class VesselSchema extends SchemaBase<VesselSchemaData> {
2774
2835
  location: new LocalPositionSchema().schema,
2775
2836
  state: new StateSchema().schema,
2776
2837
  material: new MaterialSchema().schema,
2838
+ safetySystem: new SafetySystemSchema().schema,
2777
2839
  diameter: Joi.number().unsafe(),
2778
2840
  height: Joi.number().unsafe(),
2779
2841
  length: Joi.number().unsafe(),
@@ -2794,6 +2856,7 @@ export class VesselSchema extends SchemaBase<VesselSchemaData> {
2794
2856
  location: "LocalPosition",
2795
2857
  state: "State",
2796
2858
  material: "Material",
2859
+ safetySystem: "SafetySystem",
2797
2860
  diameter: "number",
2798
2861
  height: "number",
2799
2862
  length: "number",
@@ -2812,6 +2875,7 @@ export class VesselSchema extends SchemaBase<VesselSchemaData> {
2812
2875
  data.location,
2813
2876
  data.state,
2814
2877
  data.material,
2878
+ data.safetySystem,
2815
2879
  data.diameter,
2816
2880
  data.height,
2817
2881
  data.length,
package/src/enums.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.25
4
- * Date/time: 25 Feb 2025 23:06:02
3
+ * Version: 1.0.26
4
+ * Date/time: 17 Mar 2025 16:56:35
5
5
  * Template: templates/typescriptpws/enums.razor.
6
6
  ***********************************************************************/
7
7
 
@@ -106,6 +106,17 @@ export enum DayNight {
106
106
  UNSET = 0,
107
107
  }
108
108
 
109
+ /**
110
+ * DO NOT SAVE.
111
+ */
112
+ export enum DummyEnum {
113
+ /** Value 1. */
114
+ VALUE1 = 55,
115
+
116
+ /** Value 2. */
117
+ VALUE2 = 55,
118
+ }
119
+
109
120
  /**
110
121
  * Whether the release or cloud is instantaneous, continuous or time-varying.
111
122
  */
package/src/materials.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.25
4
- * Date/time: 25 Feb 2025 23:06:01
3
+ * Version: 1.0.26
4
+ * Date/time: 17 Mar 2025 16:56:34
5
5
  * Template: templates/typescriptpws/materials.razor.
6
6
  ***********************************************************************/
7
7
 
package/src/utilities.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /***********************************************************************
2
2
  * This file has been auto-generated by a code generation tool.
3
- * Version: 1.0.25
4
- * Date/time: 25 Feb 2025 23:06:00
3
+ * Version: 1.0.26
4
+ * Date/time: 17 Mar 2025 16:56:33
5
5
  * Template: templates/typescriptpws/utilities.razor.
6
6
  ***********************************************************************/
7
7