@nsshunt/ststestrunner 1.1.145 → 1.1.147
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 +4 -27
- package/dist/ststestrunner.cjs.map +1 -1
- package/dist/ststestrunner.mjs +4 -27
- package/dist/ststestrunner.mjs.map +1 -1
- package/package.json +1 -1
- package/types/commonTypes.d.ts +1 -0
- package/types/commonTypes.d.ts.map +1 -1
- package/types/libmodule/authHelper.d.ts.map +1 -1
- package/types/libmodule/testCaseFhir02.d.ts +0 -1
- package/types/libmodule/testCaseFhir02.d.ts.map +1 -1
package/dist/ststestrunner.mjs
CHANGED
|
@@ -1444,7 +1444,6 @@ var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
|
|
|
1444
1444
|
//#endregion
|
|
1445
1445
|
//#region src/libmodule/testCaseFhir02.ts
|
|
1446
1446
|
var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
|
|
1447
|
-
blockSize = 2;
|
|
1448
1447
|
bundleBatch;
|
|
1449
1448
|
personRecords = [];
|
|
1450
1449
|
PerformExecuteQuery = async () => {
|
|
@@ -1452,6 +1451,7 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
|
|
|
1452
1451
|
const client = await this.GetClient();
|
|
1453
1452
|
const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
|
|
1454
1453
|
const prefix = this.runner.options.personPrefix;
|
|
1454
|
+
const bundleSize = this.runner.options.bundleSize;
|
|
1455
1455
|
if (this.runner.iteration === 0) this.bundleBatch = {
|
|
1456
1456
|
"resourceType": "Bundle",
|
|
1457
1457
|
"type": "transaction",
|
|
@@ -1469,7 +1469,7 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
});
|
|
1471
1471
|
let retVal = void 0;
|
|
1472
|
-
if (this.runner.iteration %
|
|
1472
|
+
if (this.runner.iteration % bundleSize === bundleSize - 1) {
|
|
1473
1473
|
retVal = await client.ProcessBatchOrTransactionResources(this.bundleBatch);
|
|
1474
1474
|
this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
|
|
1475
1475
|
this.bundleBatch.entry = [];
|
|
@@ -37015,43 +37015,20 @@ var AuthHelper = class extends import_tiny_emitter.TinyEmitter {
|
|
|
37015
37015
|
}
|
|
37016
37016
|
};
|
|
37017
37017
|
GetAccessToken = async () => {
|
|
37018
|
-
let timeout = void 0;
|
|
37019
37018
|
const start = performance.now();
|
|
37020
37019
|
try {
|
|
37021
37020
|
if (this.#accesssToken) return this.#accesssToken;
|
|
37022
|
-
const lockKey = "GetAccessToken";
|
|
37023
|
-
const lockTimeout = 6e4;
|
|
37024
|
-
if (this._lockHelper.GetOnHold(lockKey) === true) try {
|
|
37025
|
-
performance.now();
|
|
37026
|
-
await this._lockHelper.WaitOnHold(lockKey, lockTimeout);
|
|
37027
|
-
if (this.#accesssToken) return this.#accesssToken;
|
|
37028
|
-
else {
|
|
37029
|
-
this.Error(chalk.red(`GetAccessToken(): Could not get existing accesssToken (post hold release), lock key: [${lockKey}]`));
|
|
37030
|
-
this.Error(chalk.red(`GetAccessToken(): continue anyway ...`));
|
|
37031
|
-
}
|
|
37032
|
-
} catch (error) {
|
|
37033
|
-
this.Error(chalk.red(`GetAccessToken(): Error: [${error}]`));
|
|
37034
|
-
}
|
|
37035
|
-
this._lockHelper.SetOnHold(lockKey);
|
|
37036
|
-
timeout = setTimeout(() => {
|
|
37037
|
-
this.Warning(chalk.magenta(`GetAccessToken(): Timeout: [${this._authMaxTimeout}] exceeded for getting access token ...`));
|
|
37038
|
-
}, this._authMaxTimeout);
|
|
37039
37021
|
const scopes = `api://fb6513e4-16fe-4931-bed8-33b82b404a14/_.stsfhir5:All`.split(" ").sort().join(" ");
|
|
37040
37022
|
const authendpointUrl = `${this._options.authOptions.asendpoint}:${this._options.authOptions.asport}`;
|
|
37041
|
-
const
|
|
37023
|
+
const retVal = await this.GetAPITokenFromAuthServerUsingScope({
|
|
37042
37024
|
clientId: "d8277fce-bb48-44c2-bbf1-257fe13a444b",
|
|
37043
37025
|
authClientSecret: "64e3ef37-c7b8-4cb1-880a-e6ad3ab36e3c",
|
|
37044
37026
|
scope: scopes,
|
|
37045
37027
|
endPoint: authendpointUrl
|
|
37046
37028
|
});
|
|
37047
|
-
|
|
37048
|
-
const totalTime = performance.now() - start;
|
|
37049
|
-
if (totalTime > this._authMaxTimeout) this.Warning(chalk.magenta(`GetAccessToken(): The total time for getting the access token: [${totalTime}]`));
|
|
37050
|
-
this.#accesssToken = workingAaccesssToken;
|
|
37051
|
-
this._lockHelper.ReleaseOnHold(lockKey);
|
|
37029
|
+
this.#accesssToken = retVal;
|
|
37052
37030
|
return this.#accesssToken;
|
|
37053
37031
|
} catch (error) {
|
|
37054
|
-
if (timeout) clearTimeout(timeout);
|
|
37055
37032
|
error.message = `GetAccessToken(): Error: [${error}], Duration until error: [${performance.now() - start}]`;
|
|
37056
37033
|
this.Error(error);
|
|
37057
37034
|
return "";
|