@neurosity/sdk 6.5.9 → 6.5.11

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 (130) hide show
  1. package/dist/browser/neurosity.iife.js +2419 -1009
  2. package/dist/browser/neurosity.js +180 -148
  3. package/dist/browser/neurosity.js.map +1 -1
  4. package/dist/cjs/__tests__/Neurosity.test.d.ts +1 -0
  5. package/dist/cjs/__tests__/Neurosity.test.js +201 -0
  6. package/dist/cjs/__tests__/WebBluetoothTransport.test.d.ts +1 -0
  7. package/dist/cjs/__tests__/WebBluetoothTransport.test.js +201 -0
  8. package/dist/cjs/__tests__/accelerometer.test.d.ts +1 -0
  9. package/dist/cjs/__tests__/accelerometer.test.js +158 -0
  10. package/dist/cjs/__tests__/auth.test.d.ts +1 -0
  11. package/dist/cjs/__tests__/auth.test.js +239 -0
  12. package/dist/cjs/__tests__/brainwaves.test.d.ts +1 -0
  13. package/dist/cjs/__tests__/brainwaves.test.js +291 -0
  14. package/dist/cjs/__tests__/device.test.d.ts +1 -0
  15. package/dist/cjs/__tests__/device.test.js +281 -0
  16. package/dist/cjs/__tests__/haptics.test.d.ts +1 -0
  17. package/dist/cjs/__tests__/haptics.test.js +162 -0
  18. package/dist/cjs/__tests__/metrics.test.d.ts +1 -0
  19. package/dist/cjs/__tests__/metrics.test.js +178 -0
  20. package/dist/cjs/__tests__/oauth.test.d.ts +1 -0
  21. package/dist/cjs/__tests__/oauth.test.js +138 -0
  22. package/dist/cjs/__tests__/settings.test.d.ts +1 -0
  23. package/dist/cjs/__tests__/settings.test.js +130 -0
  24. package/dist/cjs/__tests__/setup/webBluetooth.setup.d.ts +11 -0
  25. package/dist/cjs/__tests__/setup/webBluetooth.setup.js +35 -0
  26. package/dist/cjs/__tests__/setup.d.ts +0 -0
  27. package/dist/cjs/__tests__/setup.js +7 -0
  28. package/dist/cjs/__tests__/streaming.test.d.ts +1 -0
  29. package/dist/cjs/__tests__/streaming.test.js +259 -0
  30. package/dist/cjs/__tests__/timesync.test.d.ts +1 -0
  31. package/dist/cjs/__tests__/timesync.test.js +54 -0
  32. package/dist/cjs/__tests__/utils.test.d.ts +1 -0
  33. package/dist/cjs/__tests__/utils.test.js +281 -0
  34. package/dist/cjs/api/bluetooth/BluetoothClient.d.ts +6 -6
  35. package/dist/cjs/api/bluetooth/BluetoothTransport.d.ts +1 -1
  36. package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -4
  37. package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +2 -2
  38. package/dist/cjs/api/bluetooth/types/index.d.ts +2 -2
  39. package/dist/cjs/api/bluetooth/utils/decodeJSONChunks.d.ts +1 -1
  40. package/dist/cjs/api/bluetooth/utils/stitch.d.ts +1 -1
  41. package/dist/cjs/api/bluetooth/utils/textCodec.d.ts +1 -1
  42. package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
  43. package/dist/cjs/api/firebase/FirebaseDevice.d.ts +1 -1
  44. package/dist/cjs/api/firebase/FirebaseUser.d.ts +1 -1
  45. package/dist/cjs/api/index.js +1 -1
  46. package/dist/cjs/timesync/Timesync.d.ts +1 -1
  47. package/dist/cjs/types/awareness.d.ts +1 -1
  48. package/dist/cjs/types/brainwaves.d.ts +25 -12
  49. package/dist/cjs/types/credentials.d.ts +4 -4
  50. package/dist/cjs/types/deviceInfo.d.ts +4 -4
  51. package/dist/cjs/types/epoch.d.ts +1 -1
  52. package/dist/cjs/types/experiment.d.ts +1 -1
  53. package/dist/cjs/types/hapticEffects.d.ts +1 -1
  54. package/dist/cjs/types/marker.d.ts +1 -1
  55. package/dist/cjs/types/metrics.d.ts +2 -2
  56. package/dist/cjs/types/oauth.d.ts +4 -4
  57. package/dist/cjs/types/sample.d.ts +2 -2
  58. package/dist/cjs/types/signalQuality.d.ts +1 -1
  59. package/dist/cjs/types/skill.d.ts +2 -2
  60. package/dist/cjs/types/user.d.ts +3 -3
  61. package/dist/cjs/utils/oauth.d.ts +1 -1
  62. package/dist/cjs/utils/transferDevice.d.ts +3 -3
  63. package/dist/cjs/utils/whileOnline.d.ts +1 -1
  64. package/dist/electron/index.js +1 -1
  65. package/dist/electron/index.js.map +1 -1
  66. package/dist/esm/__tests__/Neurosity.test.d.ts +1 -0
  67. package/dist/esm/__tests__/Neurosity.test.js +199 -0
  68. package/dist/esm/__tests__/WebBluetoothTransport.test.d.ts +1 -0
  69. package/dist/esm/__tests__/WebBluetoothTransport.test.js +199 -0
  70. package/dist/esm/__tests__/accelerometer.test.d.ts +1 -0
  71. package/dist/esm/__tests__/accelerometer.test.js +156 -0
  72. package/dist/esm/__tests__/auth.test.d.ts +1 -0
  73. package/dist/esm/__tests__/auth.test.js +237 -0
  74. package/dist/esm/__tests__/brainwaves.test.d.ts +1 -0
  75. package/dist/esm/__tests__/brainwaves.test.js +289 -0
  76. package/dist/esm/__tests__/device.test.d.ts +1 -0
  77. package/dist/esm/__tests__/device.test.js +279 -0
  78. package/dist/esm/__tests__/haptics.test.d.ts +1 -0
  79. package/dist/esm/__tests__/haptics.test.js +160 -0
  80. package/dist/esm/__tests__/metrics.test.d.ts +1 -0
  81. package/dist/esm/__tests__/metrics.test.js +176 -0
  82. package/dist/esm/__tests__/oauth.test.d.ts +1 -0
  83. package/dist/esm/__tests__/oauth.test.js +133 -0
  84. package/dist/esm/__tests__/settings.test.d.ts +1 -0
  85. package/dist/esm/__tests__/settings.test.js +128 -0
  86. package/dist/esm/__tests__/setup/webBluetooth.setup.d.ts +11 -0
  87. package/dist/esm/__tests__/setup/webBluetooth.setup.js +35 -0
  88. package/dist/esm/__tests__/setup.d.ts +0 -0
  89. package/dist/esm/__tests__/setup.js +7 -0
  90. package/dist/esm/__tests__/streaming.test.d.ts +1 -0
  91. package/dist/esm/__tests__/streaming.test.js +257 -0
  92. package/dist/esm/__tests__/timesync.test.d.ts +1 -0
  93. package/dist/esm/__tests__/timesync.test.js +52 -0
  94. package/dist/esm/__tests__/utils.test.d.ts +1 -0
  95. package/dist/esm/__tests__/utils.test.js +279 -0
  96. package/dist/esm/api/bluetooth/BluetoothClient.d.ts +6 -6
  97. package/dist/esm/api/bluetooth/BluetoothTransport.d.ts +1 -1
  98. package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -4
  99. package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +2 -2
  100. package/dist/esm/api/bluetooth/types/index.d.ts +2 -2
  101. package/dist/esm/api/bluetooth/utils/decodeJSONChunks.d.ts +1 -1
  102. package/dist/esm/api/bluetooth/utils/stitch.d.ts +1 -1
  103. package/dist/esm/api/bluetooth/utils/textCodec.d.ts +1 -1
  104. package/dist/esm/api/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
  105. package/dist/esm/api/firebase/FirebaseDevice.d.ts +1 -1
  106. package/dist/esm/api/firebase/FirebaseUser.d.ts +1 -1
  107. package/dist/esm/api/index.js +2 -2
  108. package/dist/esm/neurosity.mjs +2480 -1007
  109. package/dist/esm/timesync/Timesync.d.ts +1 -1
  110. package/dist/esm/types/awareness.d.ts +1 -1
  111. package/dist/esm/types/brainwaves.d.ts +25 -12
  112. package/dist/esm/types/credentials.d.ts +4 -4
  113. package/dist/esm/types/deviceInfo.d.ts +4 -4
  114. package/dist/esm/types/epoch.d.ts +1 -1
  115. package/dist/esm/types/experiment.d.ts +1 -1
  116. package/dist/esm/types/hapticEffects.d.ts +1 -1
  117. package/dist/esm/types/marker.d.ts +1 -1
  118. package/dist/esm/types/metrics.d.ts +2 -2
  119. package/dist/esm/types/oauth.d.ts +4 -4
  120. package/dist/esm/types/sample.d.ts +2 -2
  121. package/dist/esm/types/signalQuality.d.ts +1 -1
  122. package/dist/esm/types/skill.d.ts +2 -2
  123. package/dist/esm/types/user.d.ts +3 -3
  124. package/dist/esm/utils/oauth.d.ts +1 -1
  125. package/dist/esm/utils/transferDevice.d.ts +3 -3
  126. package/dist/esm/utils/whileOnline.d.ts +1 -1
  127. package/dist/examples/neurosity.iife.js +2419 -1009
  128. package/dist/examples/neurosity.js +180 -148
  129. package/dist/examples/neurosity.mjs +2480 -1007
  130. package/package.json +17 -5
@@ -1,6 +1,6 @@
1
1
  import { Observable } from "rxjs";
2
2
  import { DeviceStatus } from "../types/status";
3
- declare type Options = {
3
+ type Options = {
4
4
  getTimesync: () => Promise<number>;
5
5
  status$: Observable<DeviceStatus>;
6
6
  bufferSize?: number;
@@ -1 +1 @@
1
- export declare type AwarenessLabels = "calm" | "focus";
1
+ export type AwarenessLabels = "calm" | "focus";
@@ -1,26 +1,39 @@
1
- export declare type BrainwavesLabel = "raw" | "rawUnfiltered" | "powerByBand" | "psd";
2
- export declare type AmplitudeByChannel = number[][];
1
+ export type BrainwavesLabel = "raw" | "rawUnfiltered" | "powerByBand" | "psd";
2
+ export type AmplitudeByChannel = number[][];
3
+ export interface BaseInfo {
4
+ samplingRate: number;
5
+ startTime: number;
6
+ channelNames: string[];
7
+ }
8
+ export interface EpochInfo extends BaseInfo {
9
+ notchFrequency?: string;
10
+ }
3
11
  export interface Epoch {
4
12
  data: AmplitudeByChannel;
5
- info: {
6
- samplingRate: number;
7
- startTime: number;
8
- };
13
+ info: EpochInfo;
14
+ }
15
+ export interface RawUnfilteredEpochInfo extends BaseInfo {
16
+ }
17
+ export interface RawUnfilteredEpoch {
18
+ data: AmplitudeByChannel;
19
+ info: RawUnfilteredEpochInfo;
20
+ }
21
+ export type PSDByChannel = number[][];
22
+ export interface PSDInfo extends BaseInfo {
23
+ notchFrequency: string;
9
24
  }
10
- export declare type PSDByChannel = number[][];
11
25
  export interface PSD {
26
+ label: "psd";
12
27
  psd: PSDByChannel;
13
28
  freqs: number[];
14
- info: {
15
- samplingRate: number;
16
- startTime: number;
17
- };
29
+ info: PSDInfo;
18
30
  }
19
- export declare type BandName = "gamma" | "beta" | "alpha" | "theta" | "delta";
31
+ export type BandName = "gamma" | "beta" | "alpha" | "theta" | "delta";
20
32
  export interface PowerByBand {
21
33
  gamma: number[];
22
34
  beta: number[];
23
35
  alpha: number[];
24
36
  theta: number[];
25
37
  delta: number[];
38
+ info: BaseInfo;
26
39
  }
@@ -1,12 +1,12 @@
1
- export declare type CustomToken = {
1
+ export type CustomToken = {
2
2
  customToken: string;
3
3
  };
4
- export declare type EmailAndPassword = {
4
+ export type EmailAndPassword = {
5
5
  email: string;
6
6
  password: string;
7
7
  };
8
- export declare type OAuthCredentials = {
8
+ export type OAuthCredentials = {
9
9
  idToken: string;
10
10
  providerId: string;
11
11
  };
12
- export declare type Credentials = EmailAndPassword | OAuthCredentials | CustomToken;
12
+ export type Credentials = EmailAndPassword | OAuthCredentials | CustomToken;
@@ -1,4 +1,4 @@
1
- export declare type OSVersion = string;
1
+ export type OSVersion = string;
2
2
  export interface DeviceInfo {
3
3
  deviceId: string;
4
4
  deviceNickname: string;
@@ -13,7 +13,7 @@ export interface DeviceInfo {
13
13
  apiVersion: string;
14
14
  emulator?: boolean;
15
15
  }
16
- declare type DeviceSelectorKeyValue = [string, string | number | string[]];
17
- declare type DeviceSelectorFunction = (devices: DeviceInfo[]) => DeviceInfo;
18
- export declare type DeviceSelector = DeviceSelectorKeyValue | DeviceSelectorFunction;
16
+ type DeviceSelectorKeyValue = [string, string | number | string[]];
17
+ type DeviceSelectorFunction = (devices: DeviceInfo[]) => DeviceInfo;
18
+ export type DeviceSelector = DeviceSelectorKeyValue | DeviceSelectorFunction;
19
19
  export {};
@@ -2,7 +2,7 @@ import { Marker } from "./marker";
2
2
  /**
3
3
  * @hidden
4
4
  */
5
- export declare type Epoch = {
5
+ export type Epoch = {
6
6
  data: number[];
7
7
  info?: {
8
8
  channelNames?: string[];
@@ -1,4 +1,4 @@
1
- export declare type Experiment = {
1
+ export type Experiment = {
2
2
  deviceId: string;
3
3
  id: string;
4
4
  labels: string[];
@@ -1,4 +1,4 @@
1
- export declare type HapticEffects = {
1
+ export type HapticEffects = {
2
2
  strongClick100: string;
3
3
  strongClick60: string;
4
4
  strongClick30: string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @hidden
3
3
  */
4
- export declare type Marker = {
4
+ export type Marker = {
5
5
  label: string;
6
6
  timestamp: number;
7
7
  };
@@ -2,11 +2,11 @@ import { PendingSubscription, Subscription } from "./subscriptions";
2
2
  /**
3
3
  * @hidden
4
4
  */
5
- declare type SubscriptionListener = Function;
5
+ type SubscriptionListener = Function;
6
6
  /**
7
7
  * @hidden
8
8
  */
9
- export declare type MetricValue = {
9
+ export type MetricValue = {
10
10
  [label: string]: any;
11
11
  };
12
12
  /**
@@ -1,4 +1,4 @@
1
- export declare type OAuthConfig = {
1
+ export type OAuthConfig = {
2
2
  clientId: string;
3
3
  clientSecret?: string;
4
4
  responseType: "token" | "code";
@@ -6,15 +6,15 @@ export declare type OAuthConfig = {
6
6
  scope: string[];
7
7
  state: string;
8
8
  };
9
- export declare type OAuthQuery = {
9
+ export type OAuthQuery = {
10
10
  clientId: string;
11
11
  clientSecret: string;
12
12
  userId: string;
13
13
  };
14
- export declare type OAuthQueryResult = {
14
+ export type OAuthQueryResult = {
15
15
  customToken: string;
16
16
  userId: string;
17
17
  };
18
- export declare type OAuthRemoveResponse = {
18
+ export type OAuthRemoveResponse = {
19
19
  ok: boolean;
20
20
  };
@@ -2,7 +2,7 @@ import { Marker } from "./marker";
2
2
  /**
3
3
  * @hidden
4
4
  */
5
- export declare type Sample = {
5
+ export type Sample = {
6
6
  data: number[];
7
7
  timestamp: number;
8
8
  count?: number;
@@ -12,4 +12,4 @@ export declare type Sample = {
12
12
  /**
13
13
  * @hidden
14
14
  */
15
- export declare type CSVSample = number[];
15
+ export type CSVSample = number[];
@@ -1,4 +1,4 @@
1
- declare type ChannelQuality = {
1
+ type ChannelQuality = {
2
2
  standardDeviation: number;
3
3
  status: "great" | "good" | "bad" | "noContact";
4
4
  };
@@ -2,7 +2,7 @@ import { Observable } from "rxjs";
2
2
  /**
3
3
  * @hidden
4
4
  */
5
- declare type SkillProps = {
5
+ type SkillProps = {
6
6
  [key: string]: string | number | boolean;
7
7
  };
8
8
  /**
@@ -37,7 +37,7 @@ export interface DeviceSkill {
37
37
  /**
38
38
  * @hidden
39
39
  */
40
- declare type SkillMetric = {
40
+ type SkillMetric = {
41
41
  [key: string]: any;
42
42
  };
43
43
  /**
@@ -1,12 +1,12 @@
1
- export declare type UserDevice = {
1
+ export type UserDevice = {
2
2
  claimedOn: number;
3
3
  };
4
- export declare type UserDevices = {
4
+ export type UserDevices = {
5
5
  [deviceId: string]: UserDevice;
6
6
  };
7
7
  /**
8
8
  * @hidden
9
9
  */
10
- export declare type UserClaims = {
10
+ export type UserClaims = {
11
11
  [claimName: string]: boolean | string;
12
12
  };
@@ -1,5 +1,5 @@
1
1
  import { Action } from "../types/actions";
2
- declare type OAuthClaims = {
2
+ type OAuthClaims = {
3
3
  oauth?: true;
4
4
  authId?: string;
5
5
  scopes?: string;
@@ -1,9 +1,9 @@
1
- export declare type TransferDeviceByEmail = {
1
+ export type TransferDeviceByEmail = {
2
2
  recipientsEmail: string;
3
3
  deviceId: string;
4
4
  };
5
- export declare type TransferDeviceByUserId = {
5
+ export type TransferDeviceByUserId = {
6
6
  recipientsUserId: string;
7
7
  deviceId: string;
8
8
  };
9
- export declare type TransferDeviceOptions = TransferDeviceByEmail | TransferDeviceByUserId;
9
+ export type TransferDeviceOptions = TransferDeviceByEmail | TransferDeviceByUserId;
@@ -1,6 +1,6 @@
1
1
  import { Observable } from "rxjs";
2
2
  import { DeviceStatus } from "../types/status";
3
- declare type Options = {
3
+ type Options = {
4
4
  status$: Observable<DeviceStatus>;
5
5
  allowWhileOnSleepMode: boolean;
6
6
  };