@nsshunt/ststestrunner 1.1.29 → 1.1.30
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 +1 -1
- 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.mjs
CHANGED
|
@@ -23,8 +23,6 @@ var TestCaseFhirBase = class {
|
|
|
23
23
|
#runner;
|
|
24
24
|
#runnerExecutionWorker;
|
|
25
25
|
#accesssToken = null;
|
|
26
|
-
#clientId = "36615b3a-b71b-49af-a68b-4180daed7a5a";
|
|
27
|
-
#clientSecret = "7fbbf116-0537-424b-904f-d8d0a62adf9e";
|
|
28
26
|
#publishTelemetryCount = 0;
|
|
29
27
|
#maxBufferSize = 50;
|
|
30
28
|
#publishTelemetryTimeout = null;
|
|
@@ -80,23 +78,23 @@ var TestCaseFhirBase = class {
|
|
|
80
78
|
const fhirRESTClient = new FhirRESTClient({
|
|
81
79
|
GetAccessToken: this.GetAccessToken,
|
|
82
80
|
user: "USR_user01@stsmda.com.au",
|
|
83
|
-
endpoint: fhirOptions.
|
|
81
|
+
endpoint: fhirOptions.stsfhirserverendpoint,
|
|
84
82
|
stsfhirapiroot: fhirOptions.stsfhirapiroot,
|
|
85
83
|
stsfhirport: fhirOptions.stsfhirport,
|
|
86
84
|
logger: defaultLogger,
|
|
87
|
-
agentManager: this.
|
|
85
|
+
agentManager: this.GetFhirAgentManager(),
|
|
88
86
|
onRetryAttempt
|
|
89
87
|
});
|
|
90
88
|
this.restFhirClient = fhirRESTClient;
|
|
91
89
|
return fhirRESTClient;
|
|
92
90
|
};
|
|
93
|
-
GetAgentManager = () => {
|
|
91
|
+
GetAgentManager = (testingAgentOptions) => {
|
|
94
92
|
let agentManager = void 0;
|
|
95
93
|
let agentOptions = void 0;
|
|
96
|
-
switch (
|
|
94
|
+
switch (testingAgentOptions.nodeAgentMode) {
|
|
97
95
|
case "no-agent": break;
|
|
98
96
|
case "custom-agent-options":
|
|
99
|
-
if (
|
|
97
|
+
if (testingAgentOptions.nodeAgentCustomOptions) agentOptions = { ...testingAgentOptions.nodeAgentCustomOptions };
|
|
100
98
|
else agentOptions = { ...this.defaultAgentOptions };
|
|
101
99
|
break;
|
|
102
100
|
case "default-agent-options":
|
|
@@ -108,7 +106,7 @@ var TestCaseFhirBase = class {
|
|
|
108
106
|
case "stress-test-extreme-agent-options":
|
|
109
107
|
agentOptions = { ...this.stressTestExtremeAgentOptions };
|
|
110
108
|
break;
|
|
111
|
-
default: throw new Error(`GetFhirSocketClient(): unknown nodeAgentMode: [${
|
|
109
|
+
default: throw new Error(`GetFhirSocketClient(): unknown nodeAgentMode: [${testingAgentOptions.nodeAgentMode}]`);
|
|
112
110
|
}
|
|
113
111
|
if (agentOptions) agentManager = createAgentManager({
|
|
114
112
|
agentOptions,
|
|
@@ -121,25 +119,31 @@ var TestCaseFhirBase = class {
|
|
|
121
119
|
});
|
|
122
120
|
return agentManager;
|
|
123
121
|
};
|
|
122
|
+
GetFhirAgentManager = () => {
|
|
123
|
+
return this.GetAgentManager(this.#options.fhirOptions.stsfhiragentOptions);
|
|
124
|
+
};
|
|
125
|
+
GetAuthAgentManager = () => {
|
|
126
|
+
return this.GetAgentManager(this.#options.authOptions.asagentoptions);
|
|
127
|
+
};
|
|
124
128
|
GetFhirSocketClient = async () => {
|
|
125
129
|
try {
|
|
126
130
|
if (this.fhirClient) return this.fhirClient;
|
|
127
131
|
const fhirOptions = this.#options.fhirOptions;
|
|
128
132
|
const options = {
|
|
129
|
-
fhirServerEndpoint: fhirOptions.
|
|
133
|
+
fhirServerEndpoint: fhirOptions.stsfhirserverendpoint,
|
|
130
134
|
fhirapiroot: fhirOptions.stsfhirapiroot,
|
|
131
135
|
fhirServerPort: fhirOptions.stsfhirport,
|
|
132
136
|
socketClientName: fhirOptions.stsfhirsocketname,
|
|
133
137
|
socketIoCustomPath: fhirOptions.stsfhirsocketcustompath,
|
|
134
138
|
timeout: fhirOptions.stsfhirsockettimeout,
|
|
135
139
|
baseUrl: fhirOptions.stsfhirbaseurl,
|
|
136
|
-
agentManager: this.
|
|
140
|
+
agentManager: this.GetFhirAgentManager(),
|
|
137
141
|
joinRooms: [],
|
|
138
142
|
logger: defaultLogger,
|
|
139
143
|
authToken: await this.GetAccessTokenForSocketClientAccess(),
|
|
140
144
|
GetAccessToken: this.GetAccessToken
|
|
141
145
|
};
|
|
142
|
-
if (this.runner.options.fhirOptions.
|
|
146
|
+
if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "socket-client-all-in-one") this.fhirClient = new FhirSocketClientAllInOne("FhirSocketClient", options);
|
|
143
147
|
else this.fhirClient = new FhirSocketClientIndividual("FhirSocketClient", options);
|
|
144
148
|
await this.fhirClient.WaitForSocketConnected();
|
|
145
149
|
return this.fhirClient;
|
|
@@ -243,7 +247,7 @@ var TestCaseFhirBase = class {
|
|
|
243
247
|
const url = endPoint ? `${endPoint}${this.#options.authOptions.asoauthapiroot}/token` : `${this.#options.authOptions.asendpoint}:${this.#options.authOptions.asport}${this.#options.authOptions.asoauthapiroot}/token`;
|
|
244
248
|
stage = `6.5: url: [${url}] payload: [${JSON.stringify(payload)}]`;
|
|
245
249
|
const axiosConfig = new STSAxiosConfig(url, "post").withDefaultHeaders().withData(payload);
|
|
246
|
-
const agentManager = this.
|
|
250
|
+
const agentManager = this.GetAuthAgentManager();
|
|
247
251
|
if (agentManager) axiosConfig.withAgentManager(agentManager);
|
|
248
252
|
const retVal = await createRetryAxiosClient({
|
|
249
253
|
maxRetries: 4,
|
|
@@ -457,7 +461,7 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
|
|
|
457
461
|
}
|
|
458
462
|
GetClient = async () => {
|
|
459
463
|
let client;
|
|
460
|
-
if (this.runner.options.fhirOptions.
|
|
464
|
+
if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "no-socket-client") client = await this.GetRESTClient();
|
|
461
465
|
else client = await this.GetFhirSocketClient();
|
|
462
466
|
return client;
|
|
463
467
|
};
|