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