@superlinked/sie-sdk 0.4.1 → 0.4.2

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/index.d.cts CHANGED
@@ -1235,7 +1235,7 @@ declare class SIEClient {
1235
1235
  private detectEndpointType;
1236
1236
  }
1237
1237
 
1238
- declare const SDK_VERSION = "0.4.1";
1238
+ declare const SDK_VERSION = "0.4.2";
1239
1239
 
1240
1240
  /**
1241
1241
  * Helpers for converting SIE encode results to plain JavaScript types.
@@ -1559,7 +1559,7 @@ declare function unpackMessage<T = unknown>(data: Uint8Array): T;
1559
1559
  /**
1560
1560
  * Image handling utilities for the SIE TypeScript SDK.
1561
1561
  *
1562
- * Per design.md Section 4.3, images are serialized as bytes for transport.
1562
+ * Images are serialized as bytes for transport.
1563
1563
  * This module handles conversion from various input formats to Uint8Array.
1564
1564
  *
1565
1565
  * Supported input formats:
@@ -1589,7 +1589,6 @@ declare function unpackMessage<T = unknown>(data: Uint8Array): T;
1589
1589
  type ImageInput = Uint8Array | ArrayBuffer | Blob | string;
1590
1590
  /**
1591
1591
  * Wire format for images sent to the server.
1592
- * Per design.md Section 4.3.
1593
1592
  */
1594
1593
  interface ImageWireFormat {
1595
1594
  data: Uint8Array;
@@ -1620,7 +1619,7 @@ declare function toImageBytes(input: ImageInput): Promise<Uint8Array>;
1620
1619
  /**
1621
1620
  * Convert image bytes to wire format for transport.
1622
1621
  *
1623
- * Per design.md Section 4.3, images are sent as:
1622
+ * Images are sent as:
1624
1623
  * `{ data: <bytes>, format: "jpeg" | "png" | "webp" }`
1625
1624
  *
1626
1625
  * @param input - Image data in any supported format
package/dist/index.d.ts CHANGED
@@ -1235,7 +1235,7 @@ declare class SIEClient {
1235
1235
  private detectEndpointType;
1236
1236
  }
1237
1237
 
1238
- declare const SDK_VERSION = "0.4.1";
1238
+ declare const SDK_VERSION = "0.4.2";
1239
1239
 
1240
1240
  /**
1241
1241
  * Helpers for converting SIE encode results to plain JavaScript types.
@@ -1559,7 +1559,7 @@ declare function unpackMessage<T = unknown>(data: Uint8Array): T;
1559
1559
  /**
1560
1560
  * Image handling utilities for the SIE TypeScript SDK.
1561
1561
  *
1562
- * Per design.md Section 4.3, images are serialized as bytes for transport.
1562
+ * Images are serialized as bytes for transport.
1563
1563
  * This module handles conversion from various input formats to Uint8Array.
1564
1564
  *
1565
1565
  * Supported input formats:
@@ -1589,7 +1589,6 @@ declare function unpackMessage<T = unknown>(data: Uint8Array): T;
1589
1589
  type ImageInput = Uint8Array | ArrayBuffer | Blob | string;
1590
1590
  /**
1591
1591
  * Wire format for images sent to the server.
1592
- * Per design.md Section 4.3.
1593
1592
  */
1594
1593
  interface ImageWireFormat {
1595
1594
  data: Uint8Array;
@@ -1620,7 +1619,7 @@ declare function toImageBytes(input: ImageInput): Promise<Uint8Array>;
1620
1619
  /**
1621
1620
  * Convert image bytes to wire format for transport.
1622
1621
  *
1623
- * Per design.md Section 4.3, images are sent as:
1622
+ * Images are sent as:
1624
1623
  * `{ data: <bytes>, format: "jpeg" | "png" | "webp" }`
1625
1624
  *
1626
1625
  * @param input - Image data in any supported format
package/dist/index.js CHANGED
@@ -269,7 +269,7 @@ function packMessage(data) {
269
269
  return encode(data, { extensionCodec });
270
270
  }
271
271
  function isNumpyArrayMap(obj) {
272
- if (typeof obj !== "object" || obj === null) {
272
+ if (obj === null || typeof obj !== "object") {
273
273
  return false;
274
274
  }
275
275
  const map = obj;
@@ -796,7 +796,7 @@ function extractDataPayload(block) {
796
796
  }
797
797
 
798
798
  // src/version.ts
799
- var SDK_VERSION = "0.4.1";
799
+ var SDK_VERSION = "0.4.2";
800
800
 
801
801
  // src/client.ts
802
802
  function sleep2(ms) {
@@ -2091,10 +2091,11 @@ var SIEClient = class {
2091
2091
  createWebSocket(url) {
2092
2092
  const headers = this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : void 0;
2093
2093
  try {
2094
- if (headers) {
2095
- return new WebSocket(url, [], { headers });
2094
+ if (!headers) {
2095
+ return new WebSocket(url);
2096
2096
  }
2097
- return new WebSocket(url);
2097
+ const args = [url, [], { headers }];
2098
+ return Reflect.construct(WebSocket, args);
2098
2099
  } catch (error) {
2099
2100
  if (headers) {
2100
2101
  throw new SIEConnectionError(