@neurosity/sdk 6.4.1 → 6.5.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.
Files changed (40) hide show
  1. package/dist/browser/neurosity.iife.js +2579 -102
  2. package/dist/browser/neurosity.js +129 -113
  3. package/dist/browser/neurosity.js.map +1 -1
  4. package/dist/cjs/api/bluetooth/BluetoothClient.d.ts +1 -1
  5. package/dist/cjs/api/bluetooth/BluetoothClient.js +10 -8
  6. package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.d.ts +3 -1
  7. package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.js +17 -17
  8. package/dist/cjs/api/bluetooth/types/index.d.ts +1 -0
  9. package/dist/cjs/api/bluetooth/utils/binaryBufferToEpoch.d.ts +51 -0
  10. package/dist/cjs/api/bluetooth/utils/binaryBufferToEpoch.js +116 -0
  11. package/dist/cjs/api/bluetooth/utils/decodeJSONChunks.d.ts +15 -0
  12. package/dist/cjs/api/bluetooth/utils/decodeJSONChunks.js +25 -0
  13. package/dist/cjs/api/bluetooth/utils/textCodec.d.ts +17 -0
  14. package/dist/cjs/api/bluetooth/utils/textCodec.js +40 -0
  15. package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.d.ts +3 -1
  16. package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.js +19 -34
  17. package/dist/electron/index.js +15 -13
  18. package/dist/electron/index.js.map +1 -1
  19. package/dist/esm/api/bluetooth/BluetoothClient.d.ts +1 -1
  20. package/dist/esm/api/bluetooth/BluetoothClient.js +10 -8
  21. package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.d.ts +3 -1
  22. package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.js +18 -18
  23. package/dist/esm/api/bluetooth/types/index.d.ts +1 -0
  24. package/dist/esm/api/bluetooth/utils/binaryBufferToEpoch.d.ts +51 -0
  25. package/dist/esm/api/bluetooth/utils/binaryBufferToEpoch.js +109 -0
  26. package/dist/esm/api/bluetooth/utils/decodeJSONChunks.d.ts +15 -0
  27. package/dist/esm/api/bluetooth/utils/decodeJSONChunks.js +21 -0
  28. package/dist/esm/api/bluetooth/utils/textCodec.d.ts +17 -0
  29. package/dist/esm/api/bluetooth/utils/textCodec.js +36 -0
  30. package/dist/esm/api/bluetooth/web/WebBluetoothTransport.d.ts +3 -1
  31. package/dist/esm/api/bluetooth/web/WebBluetoothTransport.js +20 -35
  32. package/dist/esm/neurosity.mjs +2579 -102
  33. package/dist/examples/neurosity.iife.js +2579 -102
  34. package/dist/examples/neurosity.js +129 -113
  35. package/dist/examples/neurosity.mjs +2579 -102
  36. package/package.json +2 -1
  37. package/dist/cjs/api/bluetooth/utils/encoding.d.ts +0 -3
  38. package/dist/cjs/api/bluetooth/utils/encoding.js +0 -22
  39. package/dist/esm/api/bluetooth/utils/encoding.d.ts +0 -3
  40. package/dist/esm/api/bluetooth/utils/encoding.js +0 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neurosity/sdk",
3
- "version": "6.4.1",
3
+ "version": "6.5.0",
4
4
  "description": "Neurosity SDK",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -50,6 +50,7 @@
50
50
  "dependencies": {
51
51
  "@neurosity/ipk": "^2.12.0",
52
52
  "axios": "^0.25.0",
53
+ "buffer": "^6.0.3",
53
54
  "fast-deep-equal": "^3.1.3",
54
55
  "firebase": "^8.10.0",
55
56
  "outliers": "0.0.3",
@@ -1,3 +0,0 @@
1
- import { TRANSPORT_TYPE } from "../types";
2
- export declare function encode(transportType: TRANSPORT_TYPE, data: string): Uint8Array | number[];
3
- export declare function decode(transportType: TRANSPORT_TYPE, data: Uint8Array | number[]): string;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decode = exports.encode = void 0;
4
- const types_1 = require("../types");
5
- const encoder = new TextEncoder();
6
- const decoder = new TextDecoder("utf-8");
7
- function encode(transportType, data) {
8
- if (transportType === types_1.TRANSPORT_TYPE.REACT_NATIVE) {
9
- // React Native expects a plain array of numbers and not a Uint8Array
10
- return [...encoder.encode(data)];
11
- }
12
- return encoder.encode(data);
13
- }
14
- exports.encode = encode;
15
- function decode(transportType, data) {
16
- if (transportType === types_1.TRANSPORT_TYPE.REACT_NATIVE) {
17
- // React Native outpouts a plain array of numbers and not a Uint8Array
18
- return decoder.decode(new Uint8Array(data));
19
- }
20
- return decoder.decode(data);
21
- }
22
- exports.decode = decode;
@@ -1,3 +0,0 @@
1
- import { TRANSPORT_TYPE } from "../types";
2
- export declare function encode(transportType: TRANSPORT_TYPE, data: string): Uint8Array | number[];
3
- export declare function decode(transportType: TRANSPORT_TYPE, data: Uint8Array | number[]): string;
@@ -1,17 +0,0 @@
1
- import { TRANSPORT_TYPE } from "../types";
2
- const encoder = new TextEncoder();
3
- const decoder = new TextDecoder("utf-8");
4
- export function encode(transportType, data) {
5
- if (transportType === TRANSPORT_TYPE.REACT_NATIVE) {
6
- // React Native expects a plain array of numbers and not a Uint8Array
7
- return [...encoder.encode(data)];
8
- }
9
- return encoder.encode(data);
10
- }
11
- export function decode(transportType, data) {
12
- if (transportType === TRANSPORT_TYPE.REACT_NATIVE) {
13
- // React Native outpouts a plain array of numbers and not a Uint8Array
14
- return decoder.decode(new Uint8Array(data));
15
- }
16
- return decoder.decode(data);
17
- }