@aliyun-obv/api 0.3.45 → 0.3.47

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/api.d.ts CHANGED
@@ -88,6 +88,9 @@ type SSEClientOptions = Omit<RequestInit, 'signal'> & {
88
88
  hideErrorAlert?: boolean;
89
89
  onOpen?: (response: Response) => Promise<void>;
90
90
  onClose?: () => void;
91
+ openWhenHidden?: boolean;
92
+ fetch?: typeof fetch;
93
+ fetchEventSourceConfig?: Record<string, any>;
91
94
  };
92
95
  interface IsseClient extends Omit<SSEClientOptions, 'headers'> {
93
96
  region?: string;
package/dist/api.es.js CHANGED
@@ -988,8 +988,9 @@ class SSEClient {
988
988
  }
989
989
  connect() {
990
990
  return __async$6(this, null, function* () {
991
+ var _a2, _b;
991
992
  try {
992
- fetchEventSource(this.finalUrl, {
993
+ fetchEventSource(this.finalUrl, __spreadValues$1({
993
994
  method: this.options.method,
994
995
  headers: this.options.headers,
995
996
  body: this.getRequestBody(),
@@ -997,6 +998,9 @@ class SSEClient {
997
998
  credentials: "include",
998
999
  onopen: this.options.onOpen,
999
1000
  onmessage: this.options.onMessage,
1001
+ // 切换tab,请求不中断
1002
+ openWhenHidden: (_a2 = this.options.openWhenHidden) != null ? _a2 : true,
1003
+ fetch: this.options.fetch,
1000
1004
  onerror: (error) => {
1001
1005
  if (this.options.onError) {
1002
1006
  this.options.onError(error);
@@ -1007,7 +1011,7 @@ class SSEClient {
1007
1011
  throw error;
1008
1012
  },
1009
1013
  onclose: this.options.onClose
1010
- });
1014
+ }, (_b = this.options.fetchEventSourceConfig) != null ? _b : {}));
1011
1015
  } catch (error) {
1012
1016
  throw error;
1013
1017
  }
package/package.json CHANGED
@@ -15,5 +15,5 @@
15
15
  "styled-components": "^5.2.0",
16
16
  "urijs": "^1.19.1"
17
17
  },
18
- "version": "0.3.45"
18
+ "version": "0.3.47"
19
19
  }