@nsshunt/ststestrunner 1.1.29 → 1.1.31
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/dist/ststestrunner.cjs +17 -13
- package/dist/ststestrunner.cjs.map +1 -1
- package/dist/ststestrunner.mjs +17 -13
- package/dist/ststestrunner.mjs.map +1 -1
- package/package.json +7 -7
- package/types/commonTypes.d.ts +30 -24
- package/types/commonTypes.d.ts.map +1 -1
- package/types/libmodule/testCaseFhirBase.d.ts +4 -1
- package/types/libmodule/testCaseFhirBase.d.ts.map +1 -1
package/dist/ststestrunner.cjs
CHANGED
|
@@ -46,8 +46,6 @@ var TestCaseFhirBase = class {
|
|
|
46
46
|
#runner;
|
|
47
47
|
#runnerExecutionWorker;
|
|
48
48
|
#accesssToken = null;
|
|
49
|
-
#clientId = "36615b3a-b71b-49af-a68b-4180daed7a5a";
|
|
50
|
-
#clientSecret = "7fbbf116-0537-424b-904f-d8d0a62adf9e";
|
|
51
49
|
#publishTelemetryCount = 0;
|
|
52
50
|
#maxBufferSize = 50;
|
|
53
51
|
#publishTelemetryTimeout = null;
|
|
@@ -103,23 +101,23 @@ var TestCaseFhirBase = class {
|
|
|
103
101
|
const fhirRESTClient = new _nsshunt_stsfhirclient.FhirRESTClient({
|
|
104
102
|
GetAccessToken: this.GetAccessToken,
|
|
105
103
|
user: "USR_user01@stsmda.com.au",
|
|
106
|
-
endpoint: fhirOptions.
|
|
104
|
+
endpoint: fhirOptions.stsfhirserverendpoint,
|
|
107
105
|
stsfhirapiroot: fhirOptions.stsfhirapiroot,
|
|
108
106
|
stsfhirport: fhirOptions.stsfhirport,
|
|
109
107
|
logger: _nsshunt_stsutils.defaultLogger,
|
|
110
|
-
agentManager: this.
|
|
108
|
+
agentManager: this.GetFhirAgentManager(),
|
|
111
109
|
onRetryAttempt
|
|
112
110
|
});
|
|
113
111
|
this.restFhirClient = fhirRESTClient;
|
|
114
112
|
return fhirRESTClient;
|
|
115
113
|
};
|
|
116
|
-
GetAgentManager = () => {
|
|
114
|
+
GetAgentManager = (testingAgentOptions) => {
|
|
117
115
|
let agentManager = void 0;
|
|
118
116
|
let agentOptions = void 0;
|
|
119
|
-
switch (
|
|
117
|
+
switch (testingAgentOptions.nodeAgentMode) {
|
|
120
118
|
case "no-agent": break;
|
|
121
119
|
case "custom-agent-options":
|
|
122
|
-
if (
|
|
120
|
+
if (testingAgentOptions.nodeAgentCustomOptions) agentOptions = { ...testingAgentOptions.nodeAgentCustomOptions };
|
|
123
121
|
else agentOptions = { ...this.defaultAgentOptions };
|
|
124
122
|
break;
|
|
125
123
|
case "default-agent-options":
|
|
@@ -131,7 +129,7 @@ var TestCaseFhirBase = class {
|
|
|
131
129
|
case "stress-test-extreme-agent-options":
|
|
132
130
|
agentOptions = { ...this.stressTestExtremeAgentOptions };
|
|
133
131
|
break;
|
|
134
|
-
default: throw new Error(`GetFhirSocketClient(): unknown nodeAgentMode: [${
|
|
132
|
+
default: throw new Error(`GetFhirSocketClient(): unknown nodeAgentMode: [${testingAgentOptions.nodeAgentMode}]`);
|
|
135
133
|
}
|
|
136
134
|
if (agentOptions) agentManager = (0, _nsshunt_stsutils.createAgentManager)({
|
|
137
135
|
agentOptions,
|
|
@@ -144,25 +142,31 @@ var TestCaseFhirBase = class {
|
|
|
144
142
|
});
|
|
145
143
|
return agentManager;
|
|
146
144
|
};
|
|
145
|
+
GetFhirAgentManager = () => {
|
|
146
|
+
return this.GetAgentManager(this.#options.fhirOptions.stsfhiragentOptions);
|
|
147
|
+
};
|
|
148
|
+
GetAuthAgentManager = () => {
|
|
149
|
+
return this.GetAgentManager(this.#options.authOptions.asagentoptions);
|
|
150
|
+
};
|
|
147
151
|
GetFhirSocketClient = async () => {
|
|
148
152
|
try {
|
|
149
153
|
if (this.fhirClient) return this.fhirClient;
|
|
150
154
|
const fhirOptions = this.#options.fhirOptions;
|
|
151
155
|
const options = {
|
|
152
|
-
fhirServerEndpoint: fhirOptions.
|
|
156
|
+
fhirServerEndpoint: fhirOptions.stsfhirserverendpoint,
|
|
153
157
|
fhirapiroot: fhirOptions.stsfhirapiroot,
|
|
154
158
|
fhirServerPort: fhirOptions.stsfhirport,
|
|
155
159
|
socketClientName: fhirOptions.stsfhirsocketname,
|
|
156
160
|
socketIoCustomPath: fhirOptions.stsfhirsocketcustompath,
|
|
157
161
|
timeout: fhirOptions.stsfhirsockettimeout,
|
|
158
162
|
baseUrl: fhirOptions.stsfhirbaseurl,
|
|
159
|
-
agentManager: this.
|
|
163
|
+
agentManager: this.GetFhirAgentManager(),
|
|
160
164
|
joinRooms: [],
|
|
161
165
|
logger: _nsshunt_stsutils.defaultLogger,
|
|
162
166
|
authToken: await this.GetAccessTokenForSocketClientAccess(),
|
|
163
167
|
GetAccessToken: this.GetAccessToken
|
|
164
168
|
};
|
|
165
|
-
if (this.runner.options.fhirOptions.
|
|
169
|
+
if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "socket-client-all-in-one") this.fhirClient = new _nsshunt_stsfhirclient.FhirSocketClientAllInOne("FhirSocketClient", options);
|
|
166
170
|
else this.fhirClient = new _nsshunt_stsfhirclient.FhirSocketClientIndividual("FhirSocketClient", options);
|
|
167
171
|
await this.fhirClient.WaitForSocketConnected();
|
|
168
172
|
return this.fhirClient;
|
|
@@ -266,7 +270,7 @@ var TestCaseFhirBase = class {
|
|
|
266
270
|
const url = endPoint ? `${endPoint}${this.#options.authOptions.asoauthapiroot}/token` : `${this.#options.authOptions.asendpoint}:${this.#options.authOptions.asport}${this.#options.authOptions.asoauthapiroot}/token`;
|
|
267
271
|
stage = `6.5: url: [${url}] payload: [${JSON.stringify(payload)}]`;
|
|
268
272
|
const axiosConfig = new _nsshunt_stsutils.STSAxiosConfig(url, "post").withDefaultHeaders().withData(payload);
|
|
269
|
-
const agentManager = this.
|
|
273
|
+
const agentManager = this.GetAuthAgentManager();
|
|
270
274
|
if (agentManager) axiosConfig.withAgentManager(agentManager);
|
|
271
275
|
const retVal = await (0, _nsshunt_stsfhirclient.createRetryAxiosClient)({
|
|
272
276
|
maxRetries: 4,
|
|
@@ -480,7 +484,7 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
|
|
|
480
484
|
}
|
|
481
485
|
GetClient = async () => {
|
|
482
486
|
let client;
|
|
483
|
-
if (this.runner.options.fhirOptions.
|
|
487
|
+
if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "no-socket-client") client = await this.GetRESTClient();
|
|
484
488
|
else client = await this.GetFhirSocketClient();
|
|
485
489
|
return client;
|
|
486
490
|
};
|