@nsshunt/ststestrunner 1.0.23 → 1.0.25

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.
@@ -11961,7 +11961,24 @@ class FhirSocketClient {
11961
11961
  socket.emit("__STSjoinRoom", joinRooms);
11962
11962
  }
11963
11963
  });
11964
+ __publicField2(this, "WaitForSocketConnected", async () => {
11965
+ console.log(chalk.gray(`WaitForSocketConnected(): Waiting for socket connection [Start]`));
11966
+ if (this.socket && this.socket.connected === true) {
11967
+ return;
11968
+ }
11969
+ let connected = false;
11970
+ while (!connected) {
11971
+ console.log(chalk.gray(`WaitForSocketConnected(): Waiting for socket connection ...`));
11972
+ const socketRetVal = this.socket;
11973
+ if (socketRetVal && socketRetVal.connected === true) {
11974
+ connected = true;
11975
+ break;
11976
+ }
11977
+ await Sleep(100);
11978
+ }
11979
+ });
11964
11980
  __publicField2(this, "CreateResource", async (resource, domainResource) => {
11981
+ await this.WaitForSocketConnected();
11965
11982
  const promCreate = () => {
11966
11983
  const request = {
11967
11984
  headers: {
@@ -11984,6 +12001,7 @@ class FhirSocketClient {
11984
12001
  return promCreate();
11985
12002
  });
11986
12003
  __publicField2(this, "CreateResources", async (resource, domainResources) => {
12004
+ await this.WaitForSocketConnected();
11987
12005
  const promCreate = () => {
11988
12006
  const request = {
11989
12007
  headers: {
@@ -12006,6 +12024,7 @@ class FhirSocketClient {
12006
12024
  return (await promCreate()).value;
12007
12025
  });
12008
12026
  __publicField2(this, "GetResource", async (resource, resourceId) => {
12027
+ await this.WaitForSocketConnected();
12009
12028
  const promGet = () => {
12010
12029
  const request = {
12011
12030
  headers: {
@@ -12030,6 +12049,7 @@ class FhirSocketClient {
12030
12049
  return promGet();
12031
12050
  });
12032
12051
  __publicField2(this, "GetResources", async (resource, searchParams) => {
12052
+ await this.WaitForSocketConnected();
12033
12053
  const promGet = () => {
12034
12054
  const request = {
12035
12055
  headers: {
@@ -12052,6 +12072,7 @@ class FhirSocketClient {
12052
12072
  return (await promGet()).value;
12053
12073
  });
12054
12074
  __publicField2(this, "UpdateResource", async (resource, domainResource) => {
12075
+ await this.WaitForSocketConnected();
12055
12076
  const promCreate = () => {
12056
12077
  const request = {
12057
12078
  headers: {
@@ -12076,6 +12097,7 @@ class FhirSocketClient {
12076
12097
  return (await promCreate()).value;
12077
12098
  });
12078
12099
  __publicField2(this, "UpdateResources", async (resource, domainResources) => {
12100
+ await this.WaitForSocketConnected();
12079
12101
  const promCreate = () => {
12080
12102
  const request = {
12081
12103
  headers: {
@@ -12098,6 +12120,7 @@ class FhirSocketClient {
12098
12120
  return (await promCreate()).value;
12099
12121
  });
12100
12122
  __publicField2(this, "PatchResource", async (resource, domainResource) => {
12123
+ await this.WaitForSocketConnected();
12101
12124
  const promCreate = () => {
12102
12125
  const request = {
12103
12126
  headers: {
@@ -12122,6 +12145,7 @@ class FhirSocketClient {
12122
12145
  return (await promCreate()).value;
12123
12146
  });
12124
12147
  __publicField2(this, "PatchResources", async (resource, domainResources) => {
12148
+ await this.WaitForSocketConnected();
12125
12149
  const promCreate = () => {
12126
12150
  const request = {
12127
12151
  headers: {
@@ -12144,6 +12168,7 @@ class FhirSocketClient {
12144
12168
  return (await promCreate()).value;
12145
12169
  });
12146
12170
  __publicField2(this, "DeleteResource", async (resource, resourceId) => {
12171
+ await this.WaitForSocketConnected();
12147
12172
  const promCreate = () => {
12148
12173
  const request = {
12149
12174
  headers: {
@@ -12168,6 +12193,7 @@ class FhirSocketClient {
12168
12193
  return (await promCreate()).value;
12169
12194
  });
12170
12195
  __publicField2(this, "DeleteResources", async (resource, domainResource) => {
12196
+ await this.WaitForSocketConnected();
12171
12197
  const prom = () => {
12172
12198
  const delRequest = {
12173
12199
  headers: {