@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 +1 -1
- package/azure-test-job.yml +25 -0
- package/index.ts +18 -13
- package/package.json +2 -1
- package/src/calculations/applicationTools.ts +16 -12
- package/src/calculations/calculationBase.ts +40 -13
- package/src/calculations/discharge.ts +752 -109
- package/src/calculations/dispersion.ts +17 -15
- package/src/calculations/dispersionView.ts +31 -27
- package/src/calculations/fireball.ts +17 -13
- package/src/calculations/flammableWorkflow.ts +291 -0
- package/src/calculations/jetFire.ts +19 -22
- package/src/calculations/lateExplosion.ts +16 -12
- package/src/calculations/linkedRunners.ts +2715 -780
- package/src/calculations/poolFire.ts +16 -12
- package/src/calculations/properties.ts +17 -14
- package/src/calculations/radiation.ts +65 -61
- package/src/calculations/standalones.ts +16 -12
- package/src/calculations/toxics.ts +17 -13
- package/src/calculations/utilities.ts +673 -23
- package/src/constants.ts +25 -15
- package/src/entities.ts +455 -320
- package/src/entity-schemas.ts +284 -148
- package/src/enums.ts +123 -64
- package/src/materials.ts +152 -152
- package/src/utilities.ts +40 -27
package/LICENSE
CHANGED
|
@@ -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
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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,15 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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
|
-
//
|
|
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
|
|