@neurosity/sdk 6.1.1 → 6.2.1-next.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/dist/{cjs/Neurosity.d.ts → Neurosity.d.ts} +116 -2
- package/dist/{cjs/api → api}/bluetooth/BluetoothClient.d.ts +6 -6
- package/dist/{cjs/api → api}/bluetooth/constants.d.ts +0 -0
- package/dist/{cjs/api → api}/bluetooth/index.d.ts +1 -0
- package/dist/{esm/api → api}/bluetooth/react-native/ReactNativeTransport.d.ts +5 -4
- package/dist/{cjs/api → api}/bluetooth/types/index.d.ts +2 -2
- package/dist/{cjs/api → api}/bluetooth/utils/create6DigitPin.d.ts +0 -0
- package/dist/{cjs/api → api}/bluetooth/utils/csvBufferToEpoch.d.ts +0 -0
- package/dist/{cjs/api → api}/bluetooth/utils/encoding.d.ts +0 -0
- package/dist/{cjs/api → api}/bluetooth/utils/osHasBluetoothSupport.d.ts +0 -0
- package/dist/{cjs/api → api}/bluetooth/utils/stitch.d.ts +1 -1
- package/dist/{esm/api → api}/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
- package/dist/{cjs/api → api}/bluetooth/web/isMaybeWebWorkerContext.d.ts +0 -0
- package/dist/{cjs/api → api}/bluetooth/web/isWebBluetoothSupported.d.ts +0 -0
- package/dist/{cjs/api → api}/firebase/FirebaseApp.d.ts +0 -0
- package/dist/{cjs/api → api}/firebase/FirebaseDevice.d.ts +1 -1
- package/dist/{cjs/api → api}/firebase/FirebaseUser.d.ts +0 -0
- package/dist/{cjs/api → api}/firebase/config.d.ts +0 -0
- package/dist/{cjs/api → api}/firebase/deviceStore.d.ts +0 -0
- package/dist/{cjs/api → api}/firebase/index.d.ts +0 -0
- package/dist/{cjs/api → api}/https/config.d.ts +0 -0
- package/dist/{cjs/api → api}/https/createOAuthURL.d.ts +0 -0
- package/dist/{cjs/api → api}/https/getOAuthToken.d.ts +0 -0
- package/dist/{cjs/api → api}/https/utils.d.ts +0 -0
- package/dist/{esm/api → api}/index.d.ts +8 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
- package/dist/index.m.js +2 -0
- package/dist/index.m.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/{cjs/subscriptions → subscriptions}/SubscriptionManager.d.ts +0 -0
- package/dist/{cjs/timesync → timesync}/Timesync.d.ts +1 -1
- package/dist/{cjs/timesync → timesync}/index.d.ts +0 -0
- package/dist/{cjs/types → types}/status.d.ts +0 -0
- package/dist/{cjs/types → types}/streaming.d.ts +0 -0
- package/dist/{cjs/utils → utils}/errors.d.ts +0 -0
- package/dist/{cjs/utils → utils}/filterInternalKeys.d.ts +0 -0
- package/dist/{cjs/utils → utils}/hapticEffects.d.ts +0 -0
- package/dist/{cjs/utils → utils}/heartbeat.d.ts +0 -0
- package/dist/{cjs/utils → utils}/is-node.d.ts +0 -0
- package/dist/utils/metrics.d.ts +6 -0
- package/dist/{cjs/utils → utils}/oauth.d.ts +1 -1
- package/dist/{cjs/utils → utils}/pipes.d.ts +0 -0
- package/dist/{cjs/utils → utils}/platform.d.ts +0 -0
- package/dist/{cjs/utils → utils}/subscription.d.ts +0 -0
- package/dist/{cjs/utils → utils}/whileOnline.d.ts +1 -1
- package/package.json +15 -23
- package/CHANGELOG.md +0 -25
- package/dist/browser/neurosity.iife.js +0 -48711
- package/dist/browser/neurosity.js +0 -666
- package/dist/browser/neurosity.js.map +0 -1
- package/dist/cjs/Neurosity.js +0 -1244
- package/dist/cjs/api/bluetooth/BluetoothClient.js +0 -310
- package/dist/cjs/api/bluetooth/BluetoothTransport.d.ts +0 -33
- package/dist/cjs/api/bluetooth/BluetoothTransport.js +0 -2
- package/dist/cjs/api/bluetooth/constants.js +0 -9
- package/dist/cjs/api/bluetooth/index.js +0 -20
- package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.d.ts +0 -69
- package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.js +0 -405
- package/dist/cjs/api/bluetooth/react-native/types/BleManagerTypes.d.ts +0 -63
- package/dist/cjs/api/bluetooth/react-native/types/BleManagerTypes.js +0 -11
- package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +0 -180
- package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.js +0 -10
- package/dist/cjs/api/bluetooth/types/index.js +0 -22
- package/dist/cjs/api/bluetooth/utils/create6DigitPin.js +0 -8
- package/dist/cjs/api/bluetooth/utils/csvBufferToEpoch.js +0 -36
- package/dist/cjs/api/bluetooth/utils/encoding.js +0 -22
- package/dist/cjs/api/bluetooth/utils/osHasBluetoothSupport.js +0 -23
- package/dist/cjs/api/bluetooth/utils/stitch.js +0 -22
- package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.d.ts +0 -54
- package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.js +0 -430
- package/dist/cjs/api/bluetooth/web/isMaybeWebWorkerContext.js +0 -8
- package/dist/cjs/api/bluetooth/web/isWebBluetoothSupported.js +0 -11
- package/dist/cjs/api/firebase/FirebaseApp.js +0 -70
- package/dist/cjs/api/firebase/FirebaseDevice.js +0 -146
- package/dist/cjs/api/firebase/FirebaseUser.js +0 -434
- package/dist/cjs/api/firebase/config.js +0 -11
- package/dist/cjs/api/firebase/deviceStore.js +0 -191
- package/dist/cjs/api/firebase/index.js +0 -19
- package/dist/cjs/api/https/config.js +0 -4
- package/dist/cjs/api/https/createOAuthURL.js +0 -18
- package/dist/cjs/api/https/getOAuthToken.js +0 -34
- package/dist/cjs/api/https/utils.js +0 -13
- package/dist/cjs/api/index.d.ts +0 -109
- package/dist/cjs/api/index.js +0 -307
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/subscriptions/SubscriptionManager.js +0 -27
- package/dist/cjs/timesync/Timesync.js +0 -78
- package/dist/cjs/timesync/index.js +0 -17
- package/dist/cjs/types/accelerometer.d.ts +0 -10
- package/dist/cjs/types/accelerometer.js +0 -2
- package/dist/cjs/types/actions.d.ts +0 -16
- package/dist/cjs/types/actions.js +0 -2
- package/dist/cjs/types/awareness.d.ts +0 -1
- package/dist/cjs/types/awareness.js +0 -2
- package/dist/cjs/types/brainwaves.d.ts +0 -26
- package/dist/cjs/types/brainwaves.js +0 -2
- package/dist/cjs/types/calm.d.ts +0 -6
- package/dist/cjs/types/calm.js +0 -2
- package/dist/cjs/types/client.d.ts +0 -22
- package/dist/cjs/types/client.js +0 -2
- package/dist/cjs/types/credentials.d.ts +0 -12
- package/dist/cjs/types/credentials.js +0 -2
- package/dist/cjs/types/deviceInfo.d.ts +0 -18
- package/dist/cjs/types/deviceInfo.js +0 -2
- package/dist/cjs/types/epoch.d.ts +0 -12
- package/dist/cjs/types/epoch.js +0 -2
- package/dist/cjs/types/experiment.d.ts +0 -9
- package/dist/cjs/types/experiment.js +0 -2
- package/dist/cjs/types/focus.d.ts +0 -6
- package/dist/cjs/types/focus.js +0 -2
- package/dist/cjs/types/hapticEffects.d.ts +0 -125
- package/dist/cjs/types/hapticEffects.js +0 -2
- package/dist/cjs/types/kinesis.d.ts +0 -6
- package/dist/cjs/types/kinesis.js +0 -2
- package/dist/cjs/types/marker.d.ts +0 -7
- package/dist/cjs/types/marker.js +0 -2
- package/dist/cjs/types/metrics.d.ts +0 -21
- package/dist/cjs/types/metrics.js +0 -2
- package/dist/cjs/types/oauth.d.ts +0 -20
- package/dist/cjs/types/oauth.js +0 -2
- package/dist/cjs/types/options.d.ts +0 -51
- package/dist/cjs/types/options.js +0 -2
- package/dist/cjs/types/sample.d.ts +0 -15
- package/dist/cjs/types/sample.js +0 -2
- package/dist/cjs/types/settings.d.ts +0 -13
- package/dist/cjs/types/settings.js +0 -2
- package/dist/cjs/types/signalQuality.d.ts +0 -13
- package/dist/cjs/types/signalQuality.js +0 -2
- package/dist/cjs/types/skill.d.ts +0 -68
- package/dist/cjs/types/skill.js +0 -2
- package/dist/cjs/types/status.js +0 -22
- package/dist/cjs/types/streaming.js +0 -20
- package/dist/cjs/types/subscriptions.d.ts +0 -23
- package/dist/cjs/types/subscriptions.js +0 -2
- package/dist/cjs/types/training.d.ts +0 -19
- package/dist/cjs/types/training.js +0 -2
- package/dist/cjs/types/user.d.ts +0 -12
- package/dist/cjs/types/user.js +0 -2
- package/dist/cjs/utils/errors.js +0 -17
- package/dist/cjs/utils/filterInternalKeys.js +0 -21
- package/dist/cjs/utils/hapticEffects.js +0 -130
- package/dist/cjs/utils/heartbeat.js +0 -41
- package/dist/cjs/utils/is-node.js +0 -9
- package/dist/cjs/utils/metrics.d.ts +0 -1
- package/dist/cjs/utils/metrics.js +0 -56
- package/dist/cjs/utils/oauth.js +0 -92
- package/dist/cjs/utils/pick.d.ts +0 -1
- package/dist/cjs/utils/pick.js +0 -5
- package/dist/cjs/utils/pipes.js +0 -71
- package/dist/cjs/utils/platform.js +0 -47
- package/dist/cjs/utils/subscription.js +0 -55
- package/dist/cjs/utils/transferDevice.d.ts +0 -9
- package/dist/cjs/utils/transferDevice.js +0 -2
- package/dist/cjs/utils/whileOnline.js +0 -15
- package/dist/electron/index.js +0 -86
- package/dist/electron/index.js.map +0 -1
- package/dist/esm/Neurosity.d.ts +0 -619
- package/dist/esm/Neurosity.js +0 -1213
- package/dist/esm/api/bluetooth/BluetoothClient.d.ts +0 -72
- package/dist/esm/api/bluetooth/BluetoothClient.js +0 -306
- package/dist/esm/api/bluetooth/BluetoothTransport.d.ts +0 -33
- package/dist/esm/api/bluetooth/BluetoothTransport.js +0 -1
- package/dist/esm/api/bluetooth/constants.d.ts +0 -4
- package/dist/esm/api/bluetooth/constants.js +0 -6
- package/dist/esm/api/bluetooth/index.d.ts +0 -4
- package/dist/esm/api/bluetooth/index.js +0 -4
- package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.js +0 -401
- package/dist/esm/api/bluetooth/react-native/types/BleManagerTypes.d.ts +0 -63
- package/dist/esm/api/bluetooth/react-native/types/BleManagerTypes.js +0 -8
- package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +0 -180
- package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.js +0 -9
- package/dist/esm/api/bluetooth/types/index.d.ts +0 -31
- package/dist/esm/api/bluetooth/types/index.js +0 -19
- package/dist/esm/api/bluetooth/utils/create6DigitPin.d.ts +0 -1
- package/dist/esm/api/bluetooth/utils/create6DigitPin.js +0 -4
- package/dist/esm/api/bluetooth/utils/csvBufferToEpoch.d.ts +0 -11
- package/dist/esm/api/bluetooth/utils/csvBufferToEpoch.js +0 -31
- package/dist/esm/api/bluetooth/utils/encoding.d.ts +0 -3
- package/dist/esm/api/bluetooth/utils/encoding.js +0 -17
- package/dist/esm/api/bluetooth/utils/osHasBluetoothSupport.d.ts +0 -2
- package/dist/esm/api/bluetooth/utils/osHasBluetoothSupport.js +0 -16
- package/dist/esm/api/bluetooth/utils/stitch.d.ts +0 -5
- package/dist/esm/api/bluetooth/utils/stitch.js +0 -18
- package/dist/esm/api/bluetooth/web/WebBluetoothTransport.js +0 -426
- package/dist/esm/api/bluetooth/web/isMaybeWebWorkerContext.d.ts +0 -1
- package/dist/esm/api/bluetooth/web/isMaybeWebWorkerContext.js +0 -4
- package/dist/esm/api/bluetooth/web/isWebBluetoothSupported.d.ts +0 -1
- package/dist/esm/api/bluetooth/web/isWebBluetoothSupported.js +0 -7
- package/dist/esm/api/firebase/FirebaseApp.d.ts +0 -20
- package/dist/esm/api/firebase/FirebaseApp.js +0 -63
- package/dist/esm/api/firebase/FirebaseDevice.d.ts +0 -68
- package/dist/esm/api/firebase/FirebaseDevice.js +0 -139
- package/dist/esm/api/firebase/FirebaseUser.d.ts +0 -53
- package/dist/esm/api/firebase/FirebaseUser.js +0 -426
- package/dist/esm/api/firebase/config.d.ts +0 -8
- package/dist/esm/api/firebase/config.js +0 -8
- package/dist/esm/api/firebase/deviceStore.d.ts +0 -26
- package/dist/esm/api/firebase/deviceStore.js +0 -184
- package/dist/esm/api/firebase/index.d.ts +0 -3
- package/dist/esm/api/firebase/index.js +0 -3
- package/dist/esm/api/https/config.d.ts +0 -1
- package/dist/esm/api/https/config.js +0 -1
- package/dist/esm/api/https/createOAuthURL.d.ts +0 -3
- package/dist/esm/api/https/createOAuthURL.js +0 -11
- package/dist/esm/api/https/getOAuthToken.d.ts +0 -3
- package/dist/esm/api/https/getOAuthToken.js +0 -27
- package/dist/esm/api/https/utils.d.ts +0 -2
- package/dist/esm/api/https/utils.js +0 -9
- package/dist/esm/api/index.js +0 -300
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/neurosity.mjs +0 -48699
- package/dist/esm/subscriptions/SubscriptionManager.d.ts +0 -11
- package/dist/esm/subscriptions/SubscriptionManager.js +0 -23
- package/dist/esm/timesync/Timesync.d.ts +0 -20
- package/dist/esm/timesync/Timesync.js +0 -71
- package/dist/esm/timesync/index.d.ts +0 -1
- package/dist/esm/timesync/index.js +0 -1
- package/dist/esm/types/accelerometer.d.ts +0 -10
- package/dist/esm/types/accelerometer.js +0 -1
- package/dist/esm/types/actions.d.ts +0 -16
- package/dist/esm/types/actions.js +0 -1
- package/dist/esm/types/awareness.d.ts +0 -1
- package/dist/esm/types/awareness.js +0 -1
- package/dist/esm/types/brainwaves.d.ts +0 -26
- package/dist/esm/types/brainwaves.js +0 -1
- package/dist/esm/types/calm.d.ts +0 -6
- package/dist/esm/types/calm.js +0 -1
- package/dist/esm/types/client.d.ts +0 -22
- package/dist/esm/types/client.js +0 -1
- package/dist/esm/types/credentials.d.ts +0 -12
- package/dist/esm/types/credentials.js +0 -1
- package/dist/esm/types/deviceInfo.d.ts +0 -18
- package/dist/esm/types/deviceInfo.js +0 -1
- package/dist/esm/types/epoch.d.ts +0 -12
- package/dist/esm/types/epoch.js +0 -1
- package/dist/esm/types/experiment.d.ts +0 -9
- package/dist/esm/types/experiment.js +0 -1
- package/dist/esm/types/focus.d.ts +0 -6
- package/dist/esm/types/focus.js +0 -1
- package/dist/esm/types/hapticEffects.d.ts +0 -125
- package/dist/esm/types/hapticEffects.js +0 -1
- package/dist/esm/types/kinesis.d.ts +0 -6
- package/dist/esm/types/kinesis.js +0 -1
- package/dist/esm/types/marker.d.ts +0 -7
- package/dist/esm/types/marker.js +0 -1
- package/dist/esm/types/metrics.d.ts +0 -21
- package/dist/esm/types/metrics.js +0 -1
- package/dist/esm/types/oauth.d.ts +0 -20
- package/dist/esm/types/oauth.js +0 -1
- package/dist/esm/types/options.d.ts +0 -51
- package/dist/esm/types/options.js +0 -1
- package/dist/esm/types/sample.d.ts +0 -15
- package/dist/esm/types/sample.js +0 -1
- package/dist/esm/types/settings.d.ts +0 -13
- package/dist/esm/types/settings.js +0 -1
- package/dist/esm/types/signalQuality.d.ts +0 -13
- package/dist/esm/types/signalQuality.js +0 -1
- package/dist/esm/types/skill.d.ts +0 -68
- package/dist/esm/types/skill.js +0 -1
- package/dist/esm/types/status.d.ts +0 -26
- package/dist/esm/types/status.js +0 -19
- package/dist/esm/types/streaming.d.ts +0 -15
- package/dist/esm/types/streaming.js +0 -17
- package/dist/esm/types/subscriptions.d.ts +0 -23
- package/dist/esm/types/subscriptions.js +0 -1
- package/dist/esm/types/training.d.ts +0 -19
- package/dist/esm/types/training.js +0 -1
- package/dist/esm/types/user.d.ts +0 -12
- package/dist/esm/types/user.js +0 -1
- package/dist/esm/utils/errors.d.ts +0 -5
- package/dist/esm/utils/errors.js +0 -11
- package/dist/esm/utils/filterInternalKeys.d.ts +0 -3
- package/dist/esm/utils/filterInternalKeys.js +0 -17
- package/dist/esm/utils/hapticEffects.d.ts +0 -123
- package/dist/esm/utils/hapticEffects.js +0 -125
- package/dist/esm/utils/heartbeat.d.ts +0 -4
- package/dist/esm/utils/heartbeat.js +0 -33
- package/dist/esm/utils/is-node.d.ts +0 -1
- package/dist/esm/utils/is-node.js +0 -5
- package/dist/esm/utils/metrics.d.ts +0 -1
- package/dist/esm/utils/metrics.js +0 -52
- package/dist/esm/utils/oauth.d.ts +0 -9
- package/dist/esm/utils/oauth.js +0 -64
- package/dist/esm/utils/pick.d.ts +0 -1
- package/dist/esm/utils/pick.js +0 -1
- package/dist/esm/utils/pipes.d.ts +0 -46
- package/dist/esm/utils/pipes.js +0 -65
- package/dist/esm/utils/platform.d.ts +0 -30
- package/dist/esm/utils/platform.js +0 -41
- package/dist/esm/utils/subscription.d.ts +0 -6
- package/dist/esm/utils/subscription.js +0 -24
- package/dist/esm/utils/transferDevice.d.ts +0 -9
- package/dist/esm/utils/transferDevice.js +0 -1
- package/dist/esm/utils/whileOnline.d.ts +0 -8
- package/dist/esm/utils/whileOnline.js +0 -11
- package/dist/examples/auth.html +0 -32
- package/dist/examples/cloud.html +0 -17
- package/dist/examples/index.html +0 -1
- package/dist/examples/neurosity.iife.js +0 -48711
- package/dist/examples/neurosity.js +0 -666
- package/dist/examples/neurosity.mjs +0 -48699
- package/dist/examples/training.html +0 -49
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Subscription, Subscriptions } from "../types/subscriptions";
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
export declare class SubscriptionManager {
|
|
6
|
-
private _subscriptions;
|
|
7
|
-
get(): Subscriptions;
|
|
8
|
-
toList(): Subscription[];
|
|
9
|
-
add(subscription: Subscription): void;
|
|
10
|
-
remove(subscription: Subscription): void;
|
|
11
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hidden
|
|
3
|
-
*/
|
|
4
|
-
export class SubscriptionManager {
|
|
5
|
-
constructor() {
|
|
6
|
-
this._subscriptions = {};
|
|
7
|
-
}
|
|
8
|
-
get() {
|
|
9
|
-
return this._subscriptions;
|
|
10
|
-
}
|
|
11
|
-
toList() {
|
|
12
|
-
return Object.values(this._subscriptions);
|
|
13
|
-
}
|
|
14
|
-
add(subscription) {
|
|
15
|
-
this._subscriptions[subscription.id] = subscription;
|
|
16
|
-
}
|
|
17
|
-
remove(subscription) {
|
|
18
|
-
if (!(subscription.id in this._subscriptions)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
Reflect.deleteProperty(this._subscriptions, subscription.id);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { DeviceStatus } from "../types/status";
|
|
3
|
-
declare type Options = {
|
|
4
|
-
getTimesync: () => Promise<number>;
|
|
5
|
-
status$: Observable<DeviceStatus>;
|
|
6
|
-
bufferSize?: number;
|
|
7
|
-
updateInterval?: number;
|
|
8
|
-
};
|
|
9
|
-
export declare class Timesync {
|
|
10
|
-
options: Options;
|
|
11
|
-
_offset: number;
|
|
12
|
-
constructor(options: Options);
|
|
13
|
-
start(): void;
|
|
14
|
-
filterOutliers(): import("rxjs").UnaryFunction<Observable<number[]>, Observable<number[]>>;
|
|
15
|
-
toOffset(): import("rxjs").UnaryFunction<Observable<unknown>, Observable<number>>;
|
|
16
|
-
private average;
|
|
17
|
-
get offset(): number;
|
|
18
|
-
get timestamp(): number;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { timer, pipe, range } from "rxjs";
|
|
11
|
-
import { map, concatWith, filter, take } from "rxjs/operators";
|
|
12
|
-
import { bufferCount, concatMap, switchMap } from "rxjs/operators";
|
|
13
|
-
import outliers from "outliers";
|
|
14
|
-
import { whileOnline } from "../utils/whileOnline";
|
|
15
|
-
const defaultOptions = {
|
|
16
|
-
bufferSize: 100,
|
|
17
|
-
updateInterval: 1 * 60 * 1000 // every minute
|
|
18
|
-
};
|
|
19
|
-
export class Timesync {
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this._offset = 0;
|
|
22
|
-
this.options = Object.assign(Object.assign({}, defaultOptions), options);
|
|
23
|
-
this.start();
|
|
24
|
-
}
|
|
25
|
-
start() {
|
|
26
|
-
const { bufferSize, updateInterval, status$ } = this.options;
|
|
27
|
-
const burst$ = range(0, bufferSize);
|
|
28
|
-
const timer$ = timer(updateInterval, updateInterval).pipe(map((i) => bufferSize + i), whileOnline({
|
|
29
|
-
status$,
|
|
30
|
-
allowWhileOnSleepMode: true
|
|
31
|
-
}));
|
|
32
|
-
const firstTimeDeviceIsOnline$ = status$.pipe(filter((status) => status.state === "online"), take(1));
|
|
33
|
-
firstTimeDeviceIsOnline$
|
|
34
|
-
.pipe(switchMap(() => {
|
|
35
|
-
return burst$.pipe(concatWith(timer$), this.toOffset(), bufferCount(bufferSize, 1), this.filterOutliers(), map((list) => this.average(list)));
|
|
36
|
-
}))
|
|
37
|
-
.subscribe((offset) => {
|
|
38
|
-
this._offset = offset;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
filterOutliers() {
|
|
42
|
-
return pipe(map((offsets) => {
|
|
43
|
-
return offsets.filter(outliers());
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
46
|
-
toOffset() {
|
|
47
|
-
const { getTimesync } = this.options;
|
|
48
|
-
return pipe(concatMap(() => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
const requestStartTime = Date.now();
|
|
50
|
-
const [error, serverTime] = yield getTimesync()
|
|
51
|
-
.then((offset) => [null, offset])
|
|
52
|
-
.catch((error) => [error]);
|
|
53
|
-
if (error) {
|
|
54
|
-
return 0;
|
|
55
|
-
}
|
|
56
|
-
const responseEndTime = Date.now();
|
|
57
|
-
const oneWayDuration = (responseEndTime - requestStartTime) / 2;
|
|
58
|
-
const offset = responseEndTime - oneWayDuration - serverTime;
|
|
59
|
-
return offset;
|
|
60
|
-
})));
|
|
61
|
-
}
|
|
62
|
-
average(list) {
|
|
63
|
-
return Math.round(list.reduce((acc, number) => acc + number) / list.length);
|
|
64
|
-
}
|
|
65
|
-
get offset() {
|
|
66
|
-
return this._offset;
|
|
67
|
-
}
|
|
68
|
-
get timestamp() {
|
|
69
|
-
return Date.now() + this._offset;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Timesync";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Timesync";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hidden
|
|
3
|
-
*/
|
|
4
|
-
export interface Action {
|
|
5
|
-
command: string;
|
|
6
|
-
action: string;
|
|
7
|
-
message?: any;
|
|
8
|
-
responseRequired?: boolean;
|
|
9
|
-
responseTimeout?: number;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
export interface Actions {
|
|
15
|
-
dispatch(action: Action): Promise<any>;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type AwarenessLabels = "calm" | "focus";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare type BrainwavesLabel = "raw" | "rawUnfiltered" | "powerByBand" | "psd";
|
|
2
|
-
export declare type AmplitudeByChannel = number[][];
|
|
3
|
-
export interface Epoch {
|
|
4
|
-
data: AmplitudeByChannel;
|
|
5
|
-
info: {
|
|
6
|
-
samplingRate: number;
|
|
7
|
-
startTime: number;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare type PSDByChannel = number[][];
|
|
11
|
-
export interface PSD {
|
|
12
|
-
psd: PSDByChannel;
|
|
13
|
-
freqs: number[];
|
|
14
|
-
info: {
|
|
15
|
-
samplingRate: number;
|
|
16
|
-
startTime: number;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export declare type BandName = "gamma" | "beta" | "alpha" | "theta" | "delta";
|
|
20
|
-
export interface PowerByBand {
|
|
21
|
-
gamma: number[];
|
|
22
|
-
beta: number[];
|
|
23
|
-
alpha: number[];
|
|
24
|
-
theta: number[];
|
|
25
|
-
delta: number[];
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/types/calm.d.ts
DELETED
package/dist/esm/types/calm.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { User } from "@firebase/auth-types";
|
|
3
|
-
import { Actions } from "./actions";
|
|
4
|
-
import { Metrics } from "./metrics";
|
|
5
|
-
import { SkillsClient } from "./skill";
|
|
6
|
-
import { Credentials } from "./credentials";
|
|
7
|
-
import { ChangeSettings } from "./settings";
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export interface Client {
|
|
12
|
-
user: User | null;
|
|
13
|
-
actions: Actions;
|
|
14
|
-
disconnect(): Promise<any>;
|
|
15
|
-
getInfo(): Promise<any>;
|
|
16
|
-
login?(credentials: Credentials): Promise<any>;
|
|
17
|
-
observeNamespace(namespace: string): Observable<any>;
|
|
18
|
-
metrics: Metrics;
|
|
19
|
-
skills: SkillsClient;
|
|
20
|
-
timestamp: number;
|
|
21
|
-
changeSettings(settings: ChangeSettings): Promise<void>;
|
|
22
|
-
}
|
package/dist/esm/types/client.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare type CustomToken = {
|
|
2
|
-
customToken: string;
|
|
3
|
-
};
|
|
4
|
-
export declare type EmailAndPassword = {
|
|
5
|
-
email: string;
|
|
6
|
-
password: string;
|
|
7
|
-
};
|
|
8
|
-
export declare type OAuthCredentials = {
|
|
9
|
-
idToken: string;
|
|
10
|
-
providerId: string;
|
|
11
|
-
};
|
|
12
|
-
export declare type Credentials = EmailAndPassword | OAuthCredentials | CustomToken;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface DeviceInfo {
|
|
2
|
-
deviceId: string;
|
|
3
|
-
deviceNickname: string;
|
|
4
|
-
channelNames: string[];
|
|
5
|
-
channels: number;
|
|
6
|
-
samplingRate: number;
|
|
7
|
-
manufacturer: string;
|
|
8
|
-
model: string;
|
|
9
|
-
modelName: string;
|
|
10
|
-
modelVersion: string;
|
|
11
|
-
osVersion: string;
|
|
12
|
-
apiVersion: string;
|
|
13
|
-
emulator?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare type DeviceSelectorKeyValue = [string, string | number | string[]];
|
|
16
|
-
declare type DeviceSelectorFunction = (devices: DeviceInfo[]) => DeviceInfo;
|
|
17
|
-
export declare type DeviceSelector = DeviceSelectorKeyValue | DeviceSelectorFunction;
|
|
18
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/types/epoch.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/types/focus.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
export declare type HapticEffects = {
|
|
2
|
-
strongClick100: string;
|
|
3
|
-
strongClick60: string;
|
|
4
|
-
strongClick30: string;
|
|
5
|
-
sharpClick100: string;
|
|
6
|
-
sharpClick60: string;
|
|
7
|
-
sharpClick30: string;
|
|
8
|
-
softBump100: string;
|
|
9
|
-
softBump60: string;
|
|
10
|
-
softBump30: string;
|
|
11
|
-
doubleClick100: string;
|
|
12
|
-
doubleClick60: string;
|
|
13
|
-
tripleClick100: string;
|
|
14
|
-
softFuzz60: string;
|
|
15
|
-
strongBuzz100: string;
|
|
16
|
-
alert750ms: string;
|
|
17
|
-
alert1000ms: string;
|
|
18
|
-
strongClick1_100: string;
|
|
19
|
-
strongClick2_80: string;
|
|
20
|
-
strongClick3_60: string;
|
|
21
|
-
strongClick4_30: string;
|
|
22
|
-
mediumClick1_100: string;
|
|
23
|
-
mediumClick2_80: string;
|
|
24
|
-
mediumClick3_60: string;
|
|
25
|
-
sharpTick1_100: string;
|
|
26
|
-
sharpTick2_80: string;
|
|
27
|
-
sharpTick3_60: string;
|
|
28
|
-
shortDoubleClickStrong1_100: string;
|
|
29
|
-
shortDoubleClickStrong2_80: string;
|
|
30
|
-
shortDoubleClickStrong3_60: string;
|
|
31
|
-
shortDoubleClickStrong4_30: string;
|
|
32
|
-
shortDoubleClickMedium1_100: string;
|
|
33
|
-
shortDoubleClickMedium2_80: string;
|
|
34
|
-
shortDoubleClickMedium3_60: string;
|
|
35
|
-
shortDoubleSharpTick1_100: string;
|
|
36
|
-
shortDoubleSharpTick2_80: string;
|
|
37
|
-
shortDoubleSharpTick3_60: string;
|
|
38
|
-
longDoubleSharpClickStrong1_100: string;
|
|
39
|
-
longDoubleSharpClickStrong2_80: string;
|
|
40
|
-
longDoubleSharpClickStrong3_60: string;
|
|
41
|
-
longDoubleSharpClickStrong4_30: string;
|
|
42
|
-
longDoubleSharpClickMedium1_100: string;
|
|
43
|
-
longDoubleSharpClickMedium2_80: string;
|
|
44
|
-
longDoubleSharpClickMedium3_60: string;
|
|
45
|
-
longDoubleSharpTick1_100: string;
|
|
46
|
-
longDoubleSharpTick2_80: string;
|
|
47
|
-
longDoubleSharpTick3_60: string;
|
|
48
|
-
buzz1_100: string;
|
|
49
|
-
buzz2_80: string;
|
|
50
|
-
buzz3_60: string;
|
|
51
|
-
buzz4_40: string;
|
|
52
|
-
buzz5_20: string;
|
|
53
|
-
pulsingStong1_100: string;
|
|
54
|
-
pulsingStong2_60: string;
|
|
55
|
-
pulsingMedium1_100: string;
|
|
56
|
-
pulsingMedium2_60: string;
|
|
57
|
-
pulsingSharp1_100: string;
|
|
58
|
-
pulsingSharp2_60: string;
|
|
59
|
-
transistionClick1_100: string;
|
|
60
|
-
transistionClick2_80: string;
|
|
61
|
-
transistionClick3_60: string;
|
|
62
|
-
transistionClick4_40: string;
|
|
63
|
-
transistionClick5_20: string;
|
|
64
|
-
transistionClick6_10: string;
|
|
65
|
-
transistionHum1_100: string;
|
|
66
|
-
transistionHum2_80: string;
|
|
67
|
-
transistionHum3_60: string;
|
|
68
|
-
transistionHum4_40: string;
|
|
69
|
-
transistionHum5_20: string;
|
|
70
|
-
transistionHum6_10: string;
|
|
71
|
-
transitionRampDownLongSmooth1_100_to_0: string;
|
|
72
|
-
transitionRampDownLongSmooth2_100_to_0: string;
|
|
73
|
-
transitionRampDownMediumSmooth1_100_to_0: string;
|
|
74
|
-
transitionRampDownMediumSmooth2_100_to_0: string;
|
|
75
|
-
transitionRampDownShortSmooth1_100_to_0: string;
|
|
76
|
-
transitionRampDownShortSmooth2_100_to_0: string;
|
|
77
|
-
transitionRampDownLongSharp1_100_to_0: string;
|
|
78
|
-
transitionRampDownLongSharp2_100_to_0: string;
|
|
79
|
-
transitionRampDownLongMedium1_100_to_0: string;
|
|
80
|
-
transitionRampDownLongMedium2_100_to_0: string;
|
|
81
|
-
transitionRampDownShortSharp1_100_to_0: string;
|
|
82
|
-
transitionRampDownShortSharp2_100_to_0: string;
|
|
83
|
-
transitionRampUpLongSmooth1_0_to_100: string;
|
|
84
|
-
transitionRampUpLongSmooth2_0_to_100: string;
|
|
85
|
-
transitionRampUpMediumSmooth1_0_to_100: string;
|
|
86
|
-
transitionRampUpMediumSmooth2_0_to_100: string;
|
|
87
|
-
transitionRampUpShortSmooth1_0_to_100: string;
|
|
88
|
-
transitionRampUpShortSmooth2_0_to_100: string;
|
|
89
|
-
transitionRampUpLongSharp1_0_to_100: string;
|
|
90
|
-
transitionRampUpLongSharp2_0_to_100: string;
|
|
91
|
-
transitionRampUpMediumSharp1_0_to_100: string;
|
|
92
|
-
transitionRampUpMediumSharp2_0_to_100: string;
|
|
93
|
-
transitionRampUpShortSharp1_0_to_100: string;
|
|
94
|
-
transitionRampUpShortSharp2_0_to_100: string;
|
|
95
|
-
transitionRampDownLongSmooth1_50_to_0: string;
|
|
96
|
-
transitionRampDownLongSmooth2_50_to_0: string;
|
|
97
|
-
transitionRampDownMediumSmooth1_50_to_0: string;
|
|
98
|
-
transitionRampDownMediumSmooth2_50_to_0: string;
|
|
99
|
-
transitionRampDownShortSmooth1_50_to_0: string;
|
|
100
|
-
transitionRampDownShortSmooth2_50_to_0: string;
|
|
101
|
-
transitionRampDownLongSharp1_50_to_0: string;
|
|
102
|
-
transitionRampDownLongSharp2_50_to_0: string;
|
|
103
|
-
transitionRampDownMediumSharp1_50_to_0: string;
|
|
104
|
-
transitionRampDownMediumSharp2_50_to_0: string;
|
|
105
|
-
transitionRampDownShortSharp1_50_to_0: string;
|
|
106
|
-
transitionRampDownShortSharp2_50_to_0: string;
|
|
107
|
-
transitionRampUpLongSmooth1_0_to_50: string;
|
|
108
|
-
transitionRampUpLongSmooth2_0_to_50: string;
|
|
109
|
-
transitionRampUpMediumSmooth1_0_to_50: string;
|
|
110
|
-
transitionRampUpMediumSmooth2_0_to_50: string;
|
|
111
|
-
transitionRampUpShortSmooth1_0_to_50: string;
|
|
112
|
-
transitionRampUpShortSmooth2_0_to_50: string;
|
|
113
|
-
transitionRampUpLongSharp1_0_to_50: string;
|
|
114
|
-
transitionRampUpLongSharp2_0_to_50: string;
|
|
115
|
-
transitionRampUpMediumSharp1_0_to_50: string;
|
|
116
|
-
transitionRampUpMediumSharp2_0_to_50: string;
|
|
117
|
-
transitionRampUpShortSharp1_0_to_50: string;
|
|
118
|
-
transitionRampUpShortSharp2_0_to_50: string;
|
|
119
|
-
longBuzzForProgrammaticStopping_100: string;
|
|
120
|
-
smoothHum1_50: string;
|
|
121
|
-
smoothHum2_40: string;
|
|
122
|
-
smoothHum3_30: string;
|
|
123
|
-
smoothHum4_20: string;
|
|
124
|
-
smoothHum5_10: string;
|
|
125
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/types/marker.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { PendingSubscription, Subscription } from "./subscriptions";
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
declare type SubscriptionListener = Function;
|
|
6
|
-
/**
|
|
7
|
-
* @hidden
|
|
8
|
-
*/
|
|
9
|
-
export declare type MetricValue = {
|
|
10
|
-
[label: string]: any;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @hidden
|
|
14
|
-
*/
|
|
15
|
-
export interface Metrics {
|
|
16
|
-
next(metricName: string, metricValue: MetricValue): void;
|
|
17
|
-
on(subscription: PendingSubscription, callback: Function): SubscriptionListener;
|
|
18
|
-
subscribe(subscription: PendingSubscription): Subscription;
|
|
19
|
-
unsubscribe(subscription: Subscription, listener: SubscriptionListener): void;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare type OAuthConfig = {
|
|
2
|
-
clientId: string;
|
|
3
|
-
clientSecret?: string;
|
|
4
|
-
responseType: "token" | "code";
|
|
5
|
-
redirectUri: string;
|
|
6
|
-
scope: string[];
|
|
7
|
-
state: string;
|
|
8
|
-
};
|
|
9
|
-
export declare type OAuthQuery = {
|
|
10
|
-
clientId: string;
|
|
11
|
-
clientSecret: string;
|
|
12
|
-
userId: string;
|
|
13
|
-
};
|
|
14
|
-
export declare type OAuthQueryResult = {
|
|
15
|
-
customToken: string;
|
|
16
|
-
userId: string;
|
|
17
|
-
};
|
|
18
|
-
export declare type OAuthRemoveResponse = {
|
|
19
|
-
ok: boolean;
|
|
20
|
-
};
|
package/dist/esm/types/oauth.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Skill } from "./skill";
|
|
2
|
-
import { SubscriptionManager } from "../subscriptions/SubscriptionManager";
|
|
3
|
-
import { BluetoothTransport } from "../api/bluetooth/BluetoothClient";
|
|
4
|
-
import { STREAMING_MODE } from "./streaming";
|
|
5
|
-
export interface SDKOptions {
|
|
6
|
-
deviceId?: string;
|
|
7
|
-
autoSelectDevice?: boolean;
|
|
8
|
-
timesync?: boolean;
|
|
9
|
-
bluetoothTransport?: BluetoothTransport;
|
|
10
|
-
streamingMode?: STREAMING_MODE;
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
emulator?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
emulatorHost?: string;
|
|
19
|
-
/**
|
|
20
|
-
* @hidden
|
|
21
|
-
*/
|
|
22
|
-
emulatorAuthPort?: number;
|
|
23
|
-
/**
|
|
24
|
-
* @hidden
|
|
25
|
-
*/
|
|
26
|
-
emulatorDatabasePort?: number;
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
emulatorOptions?: {
|
|
31
|
-
mockUserToken?: any;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
emulatorFunctionsPort?: number;
|
|
37
|
-
/**
|
|
38
|
-
* @hidden
|
|
39
|
-
*/
|
|
40
|
-
emulatorFirestorePort?: number;
|
|
41
|
-
/**
|
|
42
|
-
* @hidden
|
|
43
|
-
*/
|
|
44
|
-
skill?: Skill;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @hidden
|
|
48
|
-
*/
|
|
49
|
-
export interface SDKDependencies {
|
|
50
|
-
subscriptionManager: SubscriptionManager;
|
|
51
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Marker } from "./marker";
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
export declare type Sample = {
|
|
6
|
-
data: number[];
|
|
7
|
-
timestamp: number;
|
|
8
|
-
count?: number;
|
|
9
|
-
marker?: Marker;
|
|
10
|
-
info?: any;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @hidden
|
|
14
|
-
*/
|
|
15
|
-
export declare type CSVSample = number[];
|
package/dist/esm/types/sample.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare type ChannelQuality = {
|
|
2
|
-
standardDeviation: number;
|
|
3
|
-
status: "great" | "good" | "bad" | "noContact";
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Channel names for the Crown are `CP3, C3, F5, PO3, PO4, F6, C4, and CP4`
|
|
7
|
-
* These channels may change in future versions
|
|
8
|
-
* {@link ChannelQuality}
|
|
9
|
-
*/
|
|
10
|
-
export interface SignalQuality {
|
|
11
|
-
[channelName: string]: ChannelQuality;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|