@lightsparkdev/core 0.3.5 → 0.3.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lightsparkdev/core
2
2
 
3
+ ## 0.3.6
4
+
5
+ ### Patch Changes
6
+
7
+ - a09f51f: Allow websockets without ssl for local testing.
8
+
3
9
  ## 0.3.5
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -409,8 +409,12 @@ var Requester = class {
409
409
  if (typeof WebSocket === "undefined" && typeof window === "undefined") {
410
410
  websocketImpl = import_ws.default;
411
411
  }
412
+ let websocketProtocol = "wss";
413
+ if (baseUrl.startsWith("http://")) {
414
+ websocketProtocol = "ws";
415
+ }
412
416
  this.wsClient = (0, import_graphql_ws.createClient)({
413
- url: `wss://${this.stripProtocol(this.baseUrl)}/${this.schemaEndpoint}`,
417
+ url: `${websocketProtocol}://${this.stripProtocol(this.baseUrl)}/${this.schemaEndpoint}`,
414
418
  connectionParams: () => authProvider.addWsConnectionParams({}),
415
419
  webSocketImpl: websocketImpl
416
420
  });
package/dist/index.js CHANGED
@@ -357,8 +357,12 @@ var Requester = class {
357
357
  if (typeof WebSocket === "undefined" && typeof window === "undefined") {
358
358
  websocketImpl = NodeWebSocket;
359
359
  }
360
+ let websocketProtocol = "wss";
361
+ if (baseUrl.startsWith("http://")) {
362
+ websocketProtocol = "ws";
363
+ }
360
364
  this.wsClient = createClient({
361
- url: `wss://${this.stripProtocol(this.baseUrl)}/${this.schemaEndpoint}`,
365
+ url: `${websocketProtocol}://${this.stripProtocol(this.baseUrl)}/${this.schemaEndpoint}`,
362
366
  connectionParams: () => authProvider.addWsConnectionParams({}),
363
367
  webSocketImpl: websocketImpl
364
368
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/core",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -41,8 +41,14 @@ class Requester {
41
41
  if (typeof WebSocket === "undefined" && typeof window === "undefined") {
42
42
  websocketImpl = NodeWebSocket;
43
43
  }
44
+ let websocketProtocol = "wss";
45
+ if (baseUrl.startsWith("http://")) {
46
+ websocketProtocol = "ws";
47
+ }
44
48
  this.wsClient = createClient({
45
- url: `wss://${this.stripProtocol(this.baseUrl)}/${this.schemaEndpoint}`,
49
+ url: `${websocketProtocol}://${this.stripProtocol(this.baseUrl)}/${
50
+ this.schemaEndpoint
51
+ }`,
46
52
  connectionParams: () => authProvider.addWsConnectionParams({}),
47
53
  webSocketImpl: websocketImpl,
48
54
  });