@dnv-plant/typescriptpws 1.0.89 → 1.0.90
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 +2 -2
- package/package.json +2 -3
- package/src/calculations/applicationTools.ts +2 -2
- package/src/calculations/discharge.ts +2 -2
- package/src/calculations/dispersion.ts +2 -2
- package/src/calculations/dispersionView.ts +2 -2
- package/src/calculations/fireball.ts +2 -2
- package/src/calculations/jetFire.ts +2 -2
- package/src/calculations/lateExplosion.ts +2 -2
- package/src/calculations/linkedRunners.ts +2 -2
- package/src/calculations/poolFire.ts +2 -2
- package/src/calculations/properties.ts +2 -2
- package/src/calculations/radiation.ts +2 -2
- package/src/calculations/standalones.ts +2 -2
- package/src/calculations/toxics.ts +2 -2
- package/src/calculations/utilities.ts +2 -2
- package/src/constants.ts +2 -2
- package/src/entities.ts +2 -2
- package/src/entity-schemas.ts +2 -2
- package/src/enums.ts +2 -2
- package/src/materials.ts +2 -2
- package/src/utilities.ts +27 -33
package/index.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:59
|
|
11
11
|
* Template: templates/typescriptpws/index.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnv-plant/typescriptpws",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.90",
|
|
4
4
|
"description": "Integrate Phast models with our versatile APIs for enhanced customization and efficiency.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"axios": "^1.7.9",
|
|
15
15
|
"joi": "^17.13.3",
|
|
16
16
|
"jsonwebtoken": "^9.0.2",
|
|
17
|
-
"p-limit": "^6.2.0",
|
|
18
17
|
"typescript": "^5.7.3"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
@@ -22,4 +21,4 @@
|
|
|
22
21
|
"@vitest/ui": "^3.2.4",
|
|
23
22
|
"vitest": "^3.2.4"
|
|
24
23
|
}
|
|
25
|
-
}
|
|
24
|
+
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/calculations.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
package/src/constants.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:56
|
|
11
11
|
* Template: templates/typescriptpws/constants.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
package/src/entities.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:57
|
|
11
11
|
* Template: templates/typescriptpws/entities.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
package/src/entity-schemas.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:58
|
|
11
11
|
* Template: templates/typescriptpws/entityschemas.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
package/src/enums.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:57
|
|
11
11
|
* Template: templates/typescriptpws/enums.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
package/src/materials.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Editing it may lead to inconsistent results and limit DNV's ability to provide support.
|
|
7
7
|
* Please contact DNV if you believe changes are required.
|
|
8
8
|
*
|
|
9
|
-
* Version: 1.0.
|
|
10
|
-
* Date/time:
|
|
9
|
+
* Version: 1.0.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:56
|
|
11
11
|
* Template: templates/typescriptpws/materials.razor.
|
|
12
12
|
***********************************************************************/
|
|
13
13
|
|
package/src/utilities.ts
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
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.
|
|
10
|
-
* Date/time:
|
|
11
|
-
* Template: templates/typescriptpws/utilities.razor.
|
|
12
|
-
***********************************************************************/
|
|
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.90
|
|
10
|
+
* Date/time: 14 Aug 2025 11:18:55
|
|
11
|
+
* Template: templates/typescriptpws/utilities.razor.
|
|
12
|
+
***********************************************************************/
|
|
13
13
|
|
|
14
14
|
import jwt from "jsonwebtoken";
|
|
15
15
|
import axios, { AxiosResponse } from "axios";
|
|
16
|
-
import pLimit from "p-limit";
|
|
17
16
|
|
|
18
17
|
import { REST_API_URI, PWS_CLIENT_ID, REST_API_VERSION } from "./constants";
|
|
19
18
|
|
|
20
|
-
const limit = pLimit(10); // Limit concurrent requests
|
|
21
|
-
|
|
22
19
|
const accessTokenKey = "__pwsAccessToken";
|
|
23
20
|
const usedInDnvKey = "__pwsUsedInDnvKey";
|
|
24
21
|
const clientAliasKey = "__pwsClientAliasId";
|
|
@@ -82,13 +79,11 @@ export async function postRequest<T>(
|
|
|
82
79
|
throw new Error(`Expired access token (${expiryDate})`);
|
|
83
80
|
}
|
|
84
81
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
signal: controller?.signal
|
|
89
|
-
});
|
|
90
|
-
return response;
|
|
82
|
+
const response = await axiosInstance.post<T>(url, data, {
|
|
83
|
+
headers: getHeaders(accessToken),
|
|
84
|
+
signal: controller?.signal,
|
|
91
85
|
});
|
|
86
|
+
return response;
|
|
92
87
|
}
|
|
93
88
|
|
|
94
89
|
// Put JSON to URL and time the call
|
|
@@ -107,17 +102,18 @@ export async function putRequest<T>(
|
|
|
107
102
|
throw new Error(`Expired access token (${expiryDate})`);
|
|
108
103
|
}
|
|
109
104
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
signal: controller?.signal
|
|
114
|
-
});
|
|
115
|
-
return response;
|
|
105
|
+
const response = await axiosInstance.put<T>(url, data, {
|
|
106
|
+
headers: getHeaders(accessToken),
|
|
107
|
+
signal: controller?.signal,
|
|
116
108
|
});
|
|
109
|
+
return response;
|
|
117
110
|
}
|
|
118
111
|
|
|
119
112
|
// Get data from URL
|
|
120
|
-
export async function getRequest<T>(
|
|
113
|
+
export async function getRequest<T>(
|
|
114
|
+
url: string,
|
|
115
|
+
controller?: AbortController
|
|
116
|
+
): Promise<AxiosResponse<T>> {
|
|
121
117
|
const accessToken = getAccessToken();
|
|
122
118
|
if (!accessToken) {
|
|
123
119
|
throw new Error("Access token not found");
|
|
@@ -129,13 +125,11 @@ export async function getRequest<T>(url: string, controller?: AbortController):
|
|
|
129
125
|
throw new Error("Expired access token");
|
|
130
126
|
}
|
|
131
127
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
signal: controller?.signal
|
|
136
|
-
});
|
|
137
|
-
return response;
|
|
128
|
+
const response = await axiosInstance.get<T>(url, {
|
|
129
|
+
headers: getHeaders(accessToken),
|
|
130
|
+
signal: controller?.signal,
|
|
138
131
|
});
|
|
132
|
+
return response;
|
|
139
133
|
}
|
|
140
134
|
|
|
141
135
|
// Get platform, expiry date and token expiration status
|