@sanity/client 6.22.4 → 6.22.5-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "6.22.4",
3
+ "version": "6.22.5-beta.0",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "keywords": [
6
6
  "sanity",
@@ -117,7 +117,7 @@
117
117
  "singleQuote": true
118
118
  },
119
119
  "dependencies": {
120
- "@sanity/eventsource": "^5.0.2",
120
+ "eventsource": "3.0.0-beta.0",
121
121
  "get-it": "^8.6.5",
122
122
  "rxjs": "^7.0.0"
123
123
  },
@@ -85,7 +85,7 @@ export function _listen<R extends Record<string, Any> = Record<string, Any>>(
85
85
  }
86
86
 
87
87
  return new Observable((observer) => {
88
- let es: InstanceType<typeof import('@sanity/eventsource')>
88
+ let es: InstanceType<typeof import('eventsource').EventSource>
89
89
  let reconnectTimer: NodeJS.Timeout
90
90
  let stopped = false
91
91
  // Unsubscribe differs from stopped in that we will never reopen.
@@ -149,9 +149,9 @@ export function _listen<R extends Record<string, Any> = Record<string, Any>>(
149
149
  }
150
150
 
151
151
  async function getEventSource(): Promise<InstanceType<
152
- typeof import('@sanity/eventsource')
152
+ typeof import('eventsource').EventSource
153
153
  > | void> {
154
- const {default: EventSource} = await import('@sanity/eventsource')
154
+ const {EventSource} = await import('eventsource')
155
155
 
156
156
  // If the listener has been unsubscribed from before we managed to load the module,
157
157
  // do not set up the EventSource.
package/src/data/live.ts CHANGED
@@ -136,7 +136,7 @@ export class LiveClient {
136
136
  async function getEventSource() {
137
137
  const EventSourceImplementation: typeof EventSource =
138
138
  typeof EventSource === 'undefined' || esOptions.headers || esOptions.withCredentials
139
- ? ((await import('@sanity/eventsource')).default as unknown as typeof EventSource)
139
+ ? (await import('eventsource')).EventSource
140
140
  : EventSource
141
141
 
142
142
  // If the listener has been unsubscribed from before we managed to load the module,