@dnv-plant/typescriptpws 1.0.97 → 1.0.98

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2025 DNV AS
1
+ Copyright (c) 2026 DNV AS
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,25 @@
1
+ jobs:
2
+ - job: 'Test'
3
+ displayName: 'tests'
4
+ pool:
5
+ vmImage: ubuntu-latest
6
+ steps:
7
+ - checkout: self
8
+ - task: NodeTool@0
9
+ inputs:
10
+ versionSpec: '18.x'
11
+ displayName: 'Install Node.js'
12
+
13
+ - script: |
14
+ npm install
15
+ displayName: 'Install dependencies'
16
+
17
+ - script: |
18
+ npx tsc --noEmit
19
+ displayName: 'Compile TypeScript'
20
+
21
+ - script: |
22
+ npm run test -- tests
23
+ displayName: 'Run unit tests'
24
+ env:
25
+ PWS_ACCESS_TOKEN: $(PWS_ACCESS_TOKEN)
package/index.ts CHANGED
@@ -1,15 +1,19 @@
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.97
10
- * Date/time: 13 Apr 2026 17:02:52
11
- * Template: templates/typescriptpws/index.razor.
12
- ***********************************************************************/
1
+ // ************************************************************************************
2
+ // *
3
+ // * This file has been auto-generated by a code generation tool.
4
+ // *
5
+ // * DO NOT MODIFY THIS FILE
6
+ // * This file is maintained by DNV.
7
+ // * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
8
+ // * Please contact DNV if you believe changes are required.
9
+ // *
10
+ // * API version: 1.0.
11
+ // * MDE version: 9.3.8211.
12
+ // * Package version: 1.0.98
13
+ // * Date/time: 23 Jun 2026 12:11:11.
14
+ // * Template: TYPE_SCRIPT_PWS/index.sbn.
15
+ // *
16
+ // ************************************************************************************
13
17
 
14
18
  export * from './src/constants';
15
19
  export * from './src/entities';
@@ -17,10 +21,12 @@ export * from './src/entity-schemas';
17
21
  export * from './src/enums';
18
22
  export * from './src/materials';
19
23
  export * from './src/utilities';
24
+ export * from './src/calculations/applicationTools';
20
25
  export * from './src/calculations/discharge';
21
26
  export * from './src/calculations/dispersion';
22
27
  export * from './src/calculations/dispersionView';
23
28
  export * from './src/calculations/fireball';
29
+ export * from './src/calculations/flammableWorkflow';
24
30
  export * from './src/calculations/jetFire';
25
31
  export * from './src/calculations/lateExplosion';
26
32
  export * from './src/calculations/linkedRunners';
@@ -29,5 +35,4 @@ export * from './src/calculations/properties';
29
35
  export * from './src/calculations/radiation';
30
36
  export * from './src/calculations/standalones';
31
37
  export * from './src/calculations/toxics';
32
- export * from './src/calculations/applicationTools';
33
38
  export * from './src/calculations/utilities';
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@dnv-plant/typescriptpws",
3
- "version": "1.0.97",
3
+ "version": "1.0.98",
4
+ "type": "module",
4
5
  "description": "Integrate Phast models with our versatile APIs for enhanced customization and efficiency.",
5
6
  "main": "index.ts",
6
7
  "scripts": {
@@ -1,15 +1,19 @@
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.97
10
- * Date/time: 13 Apr 2026 17:02:52
11
- * Template: templates/typescriptpws/calculations.razor.
12
- ***********************************************************************/
1
+ // ************************************************************************************
2
+ // *
3
+ // * This file has been auto-generated by a code generation tool.
4
+ // *
5
+ // * DO NOT MODIFY THIS FILE
6
+ // * This file is maintained by DNV.
7
+ // * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
8
+ // * Please contact DNV if you believe changes are required.
9
+ // *
10
+ // * API version: 1.0.
11
+ // * MDE version: 9.3.8211.
12
+ // * Package version: 1.0.98
13
+ // * Date/time: 23 Jun 2026 12:11:11.
14
+ // * Template: TYPE_SCRIPT_PWS/calculations.sbn.
15
+ // *
16
+ // ************************************************************************************
13
17
 
14
18
  import * as Enums from '../enums';
15
19
  import * as Entities from '../entities';
@@ -1,15 +1,19 @@
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.97
10
- * Date/time: 13 Apr 2026 17:02:52
11
- * Template: templates/typescriptpws/calculationbase.razor.
12
- ***********************************************************************/
1
+ // ************************************************************************************
2
+ // *
3
+ // * This file has been auto-generated by a code generation tool.
4
+ // *
5
+ // * DO NOT MODIFY THIS FILE
6
+ // * This file is maintained by DNV.
7
+ // * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
8
+ // * Please contact DNV if you believe changes are required.
9
+ // *
10
+ // * API version: 1.0.
11
+ // * MDE version: 9.3.8211.
12
+ // * Package version: 1.0.98
13
+ // * Date/time: 23 Jun 2026 12:11:11.
14
+ // * Template: TYPE_SCRIPT_PWS/calculation_base.sbn.
15
+ // *
16
+ // ************************************************************************************
13
17
 
14
18
  import { ResultCode } from '../enums';
15
19
  import { postRequest } from '../utilities';
@@ -17,11 +21,34 @@ import Joi from 'joi';
17
21
  import { AxiosResponse } from 'axios';
18
22
 
19
23
  export class CalculationRequestBase {
24
+ id?: string;
25
+
26
+ /**
27
+ * Getter for Id property (PascalCase for REST API compatibility).
28
+ */
29
+ get Id(): string | undefined {
30
+ return this.id;
31
+ }
32
+
33
+ set Id(value: string | undefined) {
34
+ this.id = value;
35
+ }
36
+
20
37
  /**
21
38
  * Calculation request base class.
22
39
  */
23
40
  constructor() {
24
- // Base class initialization code
41
+ // Auto-generate a unique GUID for the request
42
+ if (typeof crypto !== 'undefined' && crypto.randomUUID) {
43
+ this.id = crypto.randomUUID();
44
+ } else {
45
+ // Fallback for older environments
46
+ this.id = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
47
+ const r = (Math.random() * 16) | 0;
48
+ const v = c === 'x' ? r : (r & 0x3) | 0x8;
49
+ return v.toString(16);
50
+ });
51
+ }
25
52
  }
26
53
  }
27
54