@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,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buzz4_40 = exports.buzz3_60 = exports.buzz2_80 = exports.buzz1_100 = exports.longDoubleSharpTick3_60 = exports.longDoubleSharpTick2_80 = exports.longDoubleSharpTick1_100 = exports.longDoubleSharpClickMedium3_60 = exports.longDoubleSharpClickMedium2_80 = exports.longDoubleSharpClickMedium1_100 = exports.longDoubleSharpClickStrong4_30 = exports.longDoubleSharpClickStrong3_60 = exports.longDoubleSharpClickStrong2_80 = exports.longDoubleSharpClickStrong1_100 = exports.shortDoubleSharpTick3_60 = exports.shortDoubleSharpTick2_80 = exports.shortDoubleSharpTick1_100 = exports.shortDoubleClickMedium3_60 = exports.shortDoubleClickMedium2_80 = exports.shortDoubleClickMedium1_100 = exports.shortDoubleClickStrong4_30 = exports.shortDoubleClickStrong3_60 = exports.shortDoubleClickStrong2_80 = exports.shortDoubleClickStrong1_100 = exports.sharpTick3_60 = exports.sharpTick2_80 = exports.sharpTick1_100 = exports.mediumClick3_60 = exports.mediumClick2_80 = exports.mediumClick1_100 = exports.strongClick4_30 = exports.strongClick3_60 = exports.strongClick2_80 = exports.strongClick1_100 = exports.alert1000ms = exports.alert750ms = exports.strongBuzz100 = exports.softFuzz60 = exports.tripleClick100 = exports.doubleClick60 = exports.doubleClick100 = exports.softBump30 = exports.softBump60 = exports.softBump100 = exports.sharpClick30 = exports.sharpClick60 = exports.sharpClick100 = exports.strongClick30 = exports.strongClick60 = exports.strongClick100 = void 0;
|
|
4
|
-
exports.transitionRampDownLongSharp1_50_to_0 = exports.transitionRampDownShortSmooth2_50_to_0 = exports.transitionRampDownShortSmooth1_50_to_0 = exports.transitionRampDownMediumSmooth2_50_to_0 = exports.transitionRampDownMediumSmooth1_50_to_0 = exports.transitionRampDownLongSmooth2_50_to_0 = exports.transitionRampDownLongSmooth1_50_to_0 = exports.transitionRampUpShortSharp2_0_to_100 = exports.transitionRampUpShortSharp1_0_to_100 = exports.transitionRampUpMediumSharp2_0_to_100 = exports.transitionRampUpMediumSharp1_0_to_100 = exports.transitionRampUpLongSharp2_0_to_100 = exports.transitionRampUpLongSharp1_0_to_100 = exports.transitionRampUpShortSmooth2_0_to_100 = exports.transitionRampUpShortSmooth1_0_to_100 = exports.transitionRampUpMediumSmooth2_0_to_100 = exports.transitionRampUpMediumSmooth1_0_to_100 = exports.transitionRampUpLongSmooth2_0_to_100 = exports.transitionRampUpLongSmooth1_0_to_100 = exports.transitionRampDownShortSharp2_100_to_0 = exports.transitionRampDownShortSharp1_100_to_0 = exports.transitionRampDownLongMedium2_100_to_0 = exports.transitionRampDownLongMedium1_100_to_0 = exports.transitionRampDownLongSharp2_100_to_0 = exports.transitionRampDownLongSharp1_100_to_0 = exports.transitionRampDownShortSmooth2_100_to_0 = exports.transitionRampDownShortSmooth1_100_to_0 = exports.transitionRampDownMediumSmooth2_100_to_0 = exports.transitionRampDownMediumSmooth1_100_to_0 = exports.transitionRampDownLongSmooth2_100_to_0 = exports.transitionRampDownLongSmooth1_100_to_0 = exports.transistionHum6_10 = exports.transistionHum5_20 = exports.transistionHum4_40 = exports.transistionHum3_60 = exports.transistionHum2_80 = exports.transistionHum1_100 = exports.transistionClick6_10 = exports.transistionClick5_20 = exports.transistionClick4_40 = exports.transistionClick3_60 = exports.transistionClick2_80 = exports.transistionClick1_100 = exports.pulsingSharp2_60 = exports.pulsingSharp1_100 = exports.pulsingMedium2_60 = exports.pulsingMedium1_100 = exports.pulsingStong2_60 = exports.pulsingStong1_100 = exports.buzz5_20 = void 0;
|
|
5
|
-
exports.smoothHum5_10 = exports.smoothHum4_20 = exports.smoothHum3_30 = exports.smoothHum2_40 = exports.smoothHum1_50 = exports.longBuzzForProgrammaticStopping_100 = exports.transitionRampUpShortSharp2_0_to_50 = exports.transitionRampUpShortSharp1_0_to_50 = exports.transitionRampUpMediumSharp2_0_to_50 = exports.transitionRampUpMediumSharp1_0_to_50 = exports.transitionRampUpLongSharp2_0_to_50 = exports.transitionRampUpLongSharp1_0_to_50 = exports.transitionRampUpShortSmooth2_0_to_50 = exports.transitionRampUpShortSmooth1_0_to_50 = exports.transitionRampUpMediumSmooth2_0_to_50 = exports.transitionRampUpMediumSmooth1_0_to_50 = exports.transitionRampUpLongSmooth2_0_to_50 = exports.transitionRampUpLongSmooth1_0_to_50 = exports.transitionRampDownShortSharp2_50_to_0 = exports.transitionRampDownShortSharp1_50_to_0 = exports.transitionRampDownMediumSharp2_50_to_0 = exports.transitionRampDownMediumSharp1_50_to_0 = exports.transitionRampDownLongSharp2_50_to_0 = void 0;
|
|
6
|
-
// All 127ish codes here:
|
|
7
|
-
/// https://cdn-learn.adafruit.com/downloads/pdf/adafruit-drv2605-haptic-controller-breakout.pdf
|
|
8
|
-
exports.strongClick100 = "strongClick100";
|
|
9
|
-
exports.strongClick60 = "strongClick60";
|
|
10
|
-
exports.strongClick30 = "strongClick30";
|
|
11
|
-
exports.sharpClick100 = "sharpClick100";
|
|
12
|
-
exports.sharpClick60 = "sharpClick60";
|
|
13
|
-
exports.sharpClick30 = "sharpClick30";
|
|
14
|
-
exports.softBump100 = "softBump100";
|
|
15
|
-
exports.softBump60 = "softBump60";
|
|
16
|
-
exports.softBump30 = "softBump30";
|
|
17
|
-
exports.doubleClick100 = "doubleClick100";
|
|
18
|
-
exports.doubleClick60 = "doubleClick60";
|
|
19
|
-
exports.tripleClick100 = "tripleClick100";
|
|
20
|
-
exports.softFuzz60 = "softFuzz60";
|
|
21
|
-
exports.strongBuzz100 = "strongBuzz100";
|
|
22
|
-
exports.alert750ms = "alert750ms";
|
|
23
|
-
exports.alert1000ms = "alert1000ms";
|
|
24
|
-
exports.strongClick1_100 = "strongClick1_100";
|
|
25
|
-
exports.strongClick2_80 = "strongClick2_80";
|
|
26
|
-
exports.strongClick3_60 = "strongClick3_60";
|
|
27
|
-
exports.strongClick4_30 = "strongClick4_30";
|
|
28
|
-
exports.mediumClick1_100 = "mediumClick1_100";
|
|
29
|
-
exports.mediumClick2_80 = "mediumClick2_80";
|
|
30
|
-
exports.mediumClick3_60 = "mediumClick3_60";
|
|
31
|
-
exports.sharpTick1_100 = "sharpTick1_100";
|
|
32
|
-
exports.sharpTick2_80 = "sharpTick2_80";
|
|
33
|
-
exports.sharpTick3_60 = "sharpTick3_60";
|
|
34
|
-
exports.shortDoubleClickStrong1_100 = "shortDoubleClickStrong1_100";
|
|
35
|
-
exports.shortDoubleClickStrong2_80 = "shortDoubleClickStrong2_80";
|
|
36
|
-
exports.shortDoubleClickStrong3_60 = "shortDoubleClickStrong3_60";
|
|
37
|
-
exports.shortDoubleClickStrong4_30 = "shortDoubleClickStrong4_30";
|
|
38
|
-
exports.shortDoubleClickMedium1_100 = "shortDoubleClickMedium1_100";
|
|
39
|
-
exports.shortDoubleClickMedium2_80 = "shortDoubleClickMedium2_80";
|
|
40
|
-
exports.shortDoubleClickMedium3_60 = "shortDoubleClickMedium3_60";
|
|
41
|
-
exports.shortDoubleSharpTick1_100 = "shortDoubleSharpTick1_100";
|
|
42
|
-
exports.shortDoubleSharpTick2_80 = "shortDoubleSharpTick2_80";
|
|
43
|
-
exports.shortDoubleSharpTick3_60 = "shortDoubleSharpTick3_60";
|
|
44
|
-
exports.longDoubleSharpClickStrong1_100 = "longDoubleSharpClickStrong1_100";
|
|
45
|
-
exports.longDoubleSharpClickStrong2_80 = "longDoubleSharpClickStrong2_80";
|
|
46
|
-
exports.longDoubleSharpClickStrong3_60 = "longDoubleSharpClickStrong3_60";
|
|
47
|
-
exports.longDoubleSharpClickStrong4_30 = "longDoubleSharpClickStrong4_30";
|
|
48
|
-
exports.longDoubleSharpClickMedium1_100 = "longDoubleSharpClickMedium1_100";
|
|
49
|
-
exports.longDoubleSharpClickMedium2_80 = "longDoubleSharpClickMedium2_80";
|
|
50
|
-
exports.longDoubleSharpClickMedium3_60 = "longDoubleSharpClickMedium3_60";
|
|
51
|
-
exports.longDoubleSharpTick1_100 = "longDoubleSharpTick1_100";
|
|
52
|
-
exports.longDoubleSharpTick2_80 = "longDoubleSharpTick2_80";
|
|
53
|
-
exports.longDoubleSharpTick3_60 = "longDoubleSharpTick3_60";
|
|
54
|
-
exports.buzz1_100 = "buzz1_100";
|
|
55
|
-
exports.buzz2_80 = "buzz2_80";
|
|
56
|
-
exports.buzz3_60 = "buzz3_60";
|
|
57
|
-
exports.buzz4_40 = "buzz4_40";
|
|
58
|
-
exports.buzz5_20 = "buzz5_20";
|
|
59
|
-
exports.pulsingStong1_100 = "pulsingStong1_100";
|
|
60
|
-
exports.pulsingStong2_60 = "pulsingStong2_60";
|
|
61
|
-
exports.pulsingMedium1_100 = "pulsingMedium1_100";
|
|
62
|
-
exports.pulsingMedium2_60 = "pulsingMedium2_60";
|
|
63
|
-
exports.pulsingSharp1_100 = "pulsingSharp1_100";
|
|
64
|
-
exports.pulsingSharp2_60 = "pulsingSharp2_60";
|
|
65
|
-
exports.transistionClick1_100 = "transistionClick1_100";
|
|
66
|
-
exports.transistionClick2_80 = "transistionClick2_80";
|
|
67
|
-
exports.transistionClick3_60 = "transistionClick3_60";
|
|
68
|
-
exports.transistionClick4_40 = "transistionClick4_40";
|
|
69
|
-
exports.transistionClick5_20 = "transistionClick5_20";
|
|
70
|
-
exports.transistionClick6_10 = "transistionClick6_10";
|
|
71
|
-
exports.transistionHum1_100 = "transistionHum1_100";
|
|
72
|
-
exports.transistionHum2_80 = "transistionHum2_80";
|
|
73
|
-
exports.transistionHum3_60 = "transistionHum3_60";
|
|
74
|
-
exports.transistionHum4_40 = "transistionHum4_40";
|
|
75
|
-
exports.transistionHum5_20 = "transistionHum5_20";
|
|
76
|
-
exports.transistionHum6_10 = "transistionHum6_10";
|
|
77
|
-
exports.transitionRampDownLongSmooth1_100_to_0 = "transitionRampDownLongSmooth1_100_to_0";
|
|
78
|
-
exports.transitionRampDownLongSmooth2_100_to_0 = "transitionRampDownLongSmooth2_100_to_0";
|
|
79
|
-
exports.transitionRampDownMediumSmooth1_100_to_0 = "transitionRampDownMediumSmooth1_100_to_0";
|
|
80
|
-
exports.transitionRampDownMediumSmooth2_100_to_0 = "transitionRampDownMediumSmooth2_100_to_0";
|
|
81
|
-
exports.transitionRampDownShortSmooth1_100_to_0 = "transitionRampDownShortSmooth1_100_to_0";
|
|
82
|
-
exports.transitionRampDownShortSmooth2_100_to_0 = "transitionRampDownShortSmooth2_100_to_0";
|
|
83
|
-
exports.transitionRampDownLongSharp1_100_to_0 = "transitionRampDownLongSharp1_100_to_0";
|
|
84
|
-
exports.transitionRampDownLongSharp2_100_to_0 = "transitionRampDownLongSharp2_100_to_0";
|
|
85
|
-
exports.transitionRampDownLongMedium1_100_to_0 = "transitionRampDownLongMedium1_100_to_0";
|
|
86
|
-
exports.transitionRampDownLongMedium2_100_to_0 = "transitionRampDownLongMedium2_100_to_0";
|
|
87
|
-
exports.transitionRampDownShortSharp1_100_to_0 = "transitionRampDownShortSharp1_100_to_0";
|
|
88
|
-
exports.transitionRampDownShortSharp2_100_to_0 = "transitionRampDownShortSharp2_100_to_0";
|
|
89
|
-
exports.transitionRampUpLongSmooth1_0_to_100 = "transitionRampUpLongSmooth1_0_to_100";
|
|
90
|
-
exports.transitionRampUpLongSmooth2_0_to_100 = "transitionRampUpLongSmooth2_0_to_100";
|
|
91
|
-
exports.transitionRampUpMediumSmooth1_0_to_100 = "transitionRampUpMediumSmooth1_0_to_100";
|
|
92
|
-
exports.transitionRampUpMediumSmooth2_0_to_100 = "transitionRampUpMediumSmooth2_0_to_100";
|
|
93
|
-
exports.transitionRampUpShortSmooth1_0_to_100 = "transitionRampUpShortSmooth1_0_to_100";
|
|
94
|
-
exports.transitionRampUpShortSmooth2_0_to_100 = "transitionRampUpShortSmooth2_0_to_100";
|
|
95
|
-
exports.transitionRampUpLongSharp1_0_to_100 = "transitionRampUpLongSharp1_0_to_100";
|
|
96
|
-
exports.transitionRampUpLongSharp2_0_to_100 = "transitionRampUpLongSharp2_0_to_100";
|
|
97
|
-
exports.transitionRampUpMediumSharp1_0_to_100 = "transitionRampUpMediumSharp1_0_to_100";
|
|
98
|
-
exports.transitionRampUpMediumSharp2_0_to_100 = "transitionRampUpMediumSharp2_0_to_100";
|
|
99
|
-
exports.transitionRampUpShortSharp1_0_to_100 = "transitionRampUpShortSharp1_0_to_100";
|
|
100
|
-
exports.transitionRampUpShortSharp2_0_to_100 = "transitionRampUpShortSharp2_0_to_100";
|
|
101
|
-
exports.transitionRampDownLongSmooth1_50_to_0 = "transitionRampDownLongSmooth1_50_to_0";
|
|
102
|
-
exports.transitionRampDownLongSmooth2_50_to_0 = "transitionRampDownLongSmooth2_50_to_0";
|
|
103
|
-
exports.transitionRampDownMediumSmooth1_50_to_0 = "transitionRampDownMediumSmooth1_50_to_0";
|
|
104
|
-
exports.transitionRampDownMediumSmooth2_50_to_0 = "transitionRampDownMediumSmooth2_50_to_0";
|
|
105
|
-
exports.transitionRampDownShortSmooth1_50_to_0 = "transitionRampDownShortSmooth1_50_to_0";
|
|
106
|
-
exports.transitionRampDownShortSmooth2_50_to_0 = "transitionRampDownShortSmooth2_50_to_0";
|
|
107
|
-
exports.transitionRampDownLongSharp1_50_to_0 = "transitionRampDownLongSharp1_50_to_0";
|
|
108
|
-
exports.transitionRampDownLongSharp2_50_to_0 = "transitionRampDownLongSharp2_50_to_0";
|
|
109
|
-
exports.transitionRampDownMediumSharp1_50_to_0 = "transitionRampDownMediumSharp1_50_to_0";
|
|
110
|
-
exports.transitionRampDownMediumSharp2_50_to_0 = "transitionRampDownMediumSharp2_50_to_0";
|
|
111
|
-
exports.transitionRampDownShortSharp1_50_to_0 = "transitionRampDownShortSharp1_50_to_0";
|
|
112
|
-
exports.transitionRampDownShortSharp2_50_to_0 = "transitionRampDownShortSharp2_50_to_0";
|
|
113
|
-
exports.transitionRampUpLongSmooth1_0_to_50 = "transitionRampUpLongSmooth1_0_to_50";
|
|
114
|
-
exports.transitionRampUpLongSmooth2_0_to_50 = "transitionRampUpLongSmooth2_0_to_50";
|
|
115
|
-
exports.transitionRampUpMediumSmooth1_0_to_50 = "transitionRampUpMediumSmooth1_0_to_50";
|
|
116
|
-
exports.transitionRampUpMediumSmooth2_0_to_50 = "transitionRampUpMediumSmooth2_0_to_50";
|
|
117
|
-
exports.transitionRampUpShortSmooth1_0_to_50 = "transitionRampUpShortSmooth1_0_to_50";
|
|
118
|
-
exports.transitionRampUpShortSmooth2_0_to_50 = "transitionRampUpShortSmooth2_0_to_50";
|
|
119
|
-
exports.transitionRampUpLongSharp1_0_to_50 = "transitionRampUpLongSharp1_0_to_50";
|
|
120
|
-
exports.transitionRampUpLongSharp2_0_to_50 = "transitionRampUpLongSharp2_0_to_50";
|
|
121
|
-
exports.transitionRampUpMediumSharp1_0_to_50 = "transitionRampUpMediumSharp1_0_to_50";
|
|
122
|
-
exports.transitionRampUpMediumSharp2_0_to_50 = "transitionRampUpMediumSharp2_0_to_50";
|
|
123
|
-
exports.transitionRampUpShortSharp1_0_to_50 = "transitionRampUpShortSharp1_0_to_50";
|
|
124
|
-
exports.transitionRampUpShortSharp2_0_to_50 = "transitionRampUpShortSharp2_0_to_50";
|
|
125
|
-
exports.longBuzzForProgrammaticStopping_100 = "longBuzzForProgrammaticStopping_100";
|
|
126
|
-
exports.smoothHum1_50 = "smoothHum1_50";
|
|
127
|
-
exports.smoothHum2_40 = "smoothHum2_40";
|
|
128
|
-
exports.smoothHum3_30 = "smoothHum3_30";
|
|
129
|
-
exports.smoothHum4_20 = "smoothHum4_20";
|
|
130
|
-
exports.smoothHum5_10 = "smoothHum5_10";
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.deviceHasLostHeartbeat = exports.heartbeatAwareStatus = void 0;
|
|
7
|
-
const rxjs_1 = require("rxjs");
|
|
8
|
-
const operators_1 = require("rxjs/operators");
|
|
9
|
-
const operators_2 = require("rxjs/operators");
|
|
10
|
-
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
11
|
-
const status_1 = require("../types/status");
|
|
12
|
-
const HEARTBEAT_UPDATE_INTERVAL = 30000; // 30 seconds - set by the OS
|
|
13
|
-
const LOST_HEARTBEAT_AFTER = HEARTBEAT_UPDATE_INTERVAL * 2.5; // 75 seconds
|
|
14
|
-
function heartbeatAwareStatus(status$) {
|
|
15
|
-
const lastLocalHeartbeat$ = status$.pipe((0, operators_1.map)(({ lastHeartbeat }) => lastHeartbeat), (0, operators_2.distinctUntilChanged)(), (0, operators_1.map)(() => Date.now()));
|
|
16
|
-
const lostHeartbeat$ = lastLocalHeartbeat$.pipe((0, operators_1.switchMap)(() => (0, rxjs_1.timer)(LOST_HEARTBEAT_AFTER)), (0, operators_1.map)(() => null), (0, operators_1.startWith)(null));
|
|
17
|
-
return (0, rxjs_1.combineLatest)({
|
|
18
|
-
status: status$,
|
|
19
|
-
lostHeartbeat: lostHeartbeat$ // @important - do not remove, adeed for state synchronization, value not used
|
|
20
|
-
}).pipe((0, operators_2.withLatestFrom)(lastLocalHeartbeat$), (0, operators_1.map)(([{ status }, lastLocalHeartbeat]) => {
|
|
21
|
-
if (!lastLocalHeartbeat) {
|
|
22
|
-
return status;
|
|
23
|
-
}
|
|
24
|
-
const lostHeartbeat = deviceHasLostHeartbeat(status, lastLocalHeartbeat);
|
|
25
|
-
return lostHeartbeat
|
|
26
|
-
? Object.assign(Object.assign({}, status), { state: status_1.STATUS.OFFLINE }) : status;
|
|
27
|
-
}), (0, operators_2.distinctUntilChanged)((a, b) => (0, fast_deep_equal_1.default)(a, b)));
|
|
28
|
-
}
|
|
29
|
-
exports.heartbeatAwareStatus = heartbeatAwareStatus;
|
|
30
|
-
function deviceHasLostHeartbeat(status, lastLocalHeartbeat) {
|
|
31
|
-
if (!("lastHeartbeat" in status)) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
// We are converting the heartbeat to the local time because the previous
|
|
35
|
-
// implementation that used the server timestamp had bug where SDK clients
|
|
36
|
-
// running on hardware with drifted/out-of-sync clocks (cough cough Android)
|
|
37
|
-
// would override the state to offline when the heartbeat was active.
|
|
38
|
-
const lostHeartbeat = Date.now() - lastLocalHeartbeat > LOST_HEARTBEAT_AFTER;
|
|
39
|
-
return lostHeartbeat;
|
|
40
|
-
}
|
|
41
|
-
exports.deviceHasLostHeartbeat = deviceHasLostHeartbeat;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNode = void 0;
|
|
4
|
-
function isNode() {
|
|
5
|
-
return (typeof process !== "undefined" &&
|
|
6
|
-
process.versions != null &&
|
|
7
|
-
process.versions.node != null);
|
|
8
|
-
}
|
|
9
|
-
exports.isNode = isNode;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCloudMetric = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const whileOnline_1 = require("./whileOnline");
|
|
7
|
-
const subscription_1 = require("./subscription");
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
function getCloudMetric(dependencies, subscription) {
|
|
12
|
-
const { options, cloudClient, onDeviceChange, status } = dependencies;
|
|
13
|
-
const { metric, labels, atomic } = subscription;
|
|
14
|
-
const metricError = (0, subscription_1.validate)(metric, labels, options);
|
|
15
|
-
if (metricError) {
|
|
16
|
-
return (0, rxjs_1.throwError)(() => metricError);
|
|
17
|
-
}
|
|
18
|
-
const metric$ = new rxjs_1.Observable((observer) => {
|
|
19
|
-
const subscriptions = atomic
|
|
20
|
-
? [
|
|
21
|
-
cloudClient.metrics.subscribe({
|
|
22
|
-
metric: metric,
|
|
23
|
-
labels: labels,
|
|
24
|
-
atomic: atomic
|
|
25
|
-
})
|
|
26
|
-
]
|
|
27
|
-
: labels.map((label) => {
|
|
28
|
-
return cloudClient.metrics.subscribe({
|
|
29
|
-
metric: metric,
|
|
30
|
-
labels: [label],
|
|
31
|
-
atomic: atomic
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
const subscriptionWithListeners = subscriptions.map((subscription) => ({
|
|
35
|
-
subscription,
|
|
36
|
-
listener: cloudClient.metrics.on(subscription, (...data) => {
|
|
37
|
-
observer.next(...data);
|
|
38
|
-
})
|
|
39
|
-
}));
|
|
40
|
-
return () => {
|
|
41
|
-
subscriptionWithListeners.forEach(({ subscription, listener }) => {
|
|
42
|
-
cloudClient.metrics.unsubscribe(subscription, listener);
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
return onDeviceChange().pipe((0, operators_1.switchMap)((device) => {
|
|
47
|
-
if (!device) {
|
|
48
|
-
return rxjs_1.EMPTY;
|
|
49
|
-
}
|
|
50
|
-
return metric$.pipe((0, whileOnline_1.whileOnline)({
|
|
51
|
-
status$: status(),
|
|
52
|
-
allowWhileOnSleepMode: false
|
|
53
|
-
}));
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
exports.getCloudMetric = getCloudMetric;
|
package/dist/cjs/utils/oauth.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.validateOAuthScopeForFunctionName = exports.validateOAuthScopeForAction = void 0;
|
|
27
|
-
const errors = __importStar(require("../utils/errors"));
|
|
28
|
-
const scopeRequiredByAction = {
|
|
29
|
-
"marker/add": "write:brainwave-markers",
|
|
30
|
-
"brainwaves/record": "write:brainwaves",
|
|
31
|
-
"haptics/queue": "write:haptics",
|
|
32
|
-
"training/record": "write:kinesis",
|
|
33
|
-
"training/stop": "write:kinesis",
|
|
34
|
-
"training/stopAll": "write:kinesis",
|
|
35
|
-
"wifi/reset": "write:wifi-settings"
|
|
36
|
-
};
|
|
37
|
-
const scopeRequiredByFunctionName = {
|
|
38
|
-
//metrics
|
|
39
|
-
accelerometer: "read:accelerometer",
|
|
40
|
-
brainwaves: "read:brainwaves",
|
|
41
|
-
calm: "read:calm",
|
|
42
|
-
focus: "read:focus",
|
|
43
|
-
kinesis: "read:kinesis",
|
|
44
|
-
predictions: "read:kinesis",
|
|
45
|
-
signalQuality: "read:signal-quality",
|
|
46
|
-
// end of metrics
|
|
47
|
-
// device info
|
|
48
|
-
getInfo: "read:devices-info",
|
|
49
|
-
getSelectedDevice: "read:devices-info",
|
|
50
|
-
selectDevice: "read:devices-info",
|
|
51
|
-
onDeviceChange: "read:devices-info",
|
|
52
|
-
onUserDevicesChange: "read:devices-info",
|
|
53
|
-
// end device info
|
|
54
|
-
settings: "read:devices-settings",
|
|
55
|
-
changeSettings: "write:devices-settings",
|
|
56
|
-
status: "read:devices-status",
|
|
57
|
-
addDevice: "write:devices-add",
|
|
58
|
-
removeDevice: "write:devices-remove",
|
|
59
|
-
transferDevice: "write:devices-remove"
|
|
60
|
-
};
|
|
61
|
-
function validateOAuthScopeForAction(userClaims, action) {
|
|
62
|
-
const { oauth, scopes: scopesString } = userClaims !== null && userClaims !== void 0 ? userClaims : {};
|
|
63
|
-
if (!oauth) {
|
|
64
|
-
return [false, null];
|
|
65
|
-
}
|
|
66
|
-
const scopes = scopesString.split(",");
|
|
67
|
-
const { command, action: actionName } = action;
|
|
68
|
-
const requiredScope = scopeRequiredByAction[`${command}/${actionName}`];
|
|
69
|
-
const hasRequireScopes = scopes.includes(requiredScope);
|
|
70
|
-
if (hasRequireScopes) {
|
|
71
|
-
return [false, null];
|
|
72
|
-
}
|
|
73
|
-
return [true, getScopeError(requiredScope)];
|
|
74
|
-
}
|
|
75
|
-
exports.validateOAuthScopeForAction = validateOAuthScopeForAction;
|
|
76
|
-
function validateOAuthScopeForFunctionName(userClaims, functionName) {
|
|
77
|
-
const { oauth, scopes: scopesString } = userClaims !== null && userClaims !== void 0 ? userClaims : {};
|
|
78
|
-
if (!oauth) {
|
|
79
|
-
return [false, null];
|
|
80
|
-
}
|
|
81
|
-
const scopes = scopesString.split(",");
|
|
82
|
-
const requiredScope = scopeRequiredByFunctionName[functionName];
|
|
83
|
-
const hasRequireScopes = scopes.includes(requiredScope);
|
|
84
|
-
if (hasRequireScopes) {
|
|
85
|
-
return [false, null];
|
|
86
|
-
}
|
|
87
|
-
return [true, getScopeError(requiredScope)];
|
|
88
|
-
}
|
|
89
|
-
exports.validateOAuthScopeForFunctionName = validateOAuthScopeForFunctionName;
|
|
90
|
-
function getScopeError(...requiredScopes) {
|
|
91
|
-
return new Error(`${errors.prefix}You are trying to access data with an OAuth token without access to the following scopes: ${requiredScopes.join(", ")}.`);
|
|
92
|
-
}
|
package/dist/cjs/utils/pick.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const pick: (object: any, props: any) => any;
|
package/dist/cjs/utils/pick.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pick = void 0;
|
|
4
|
-
const pick = (object, props) => props.reduce((acc, prop) => (Object.assign(Object.assign({}, acc), (object.hasOwnProperty(prop) ? { [prop]: object[prop] } : {}))), {});
|
|
5
|
-
exports.pick = pick;
|
package/dist/cjs/utils/pipes.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.epoch = exports.bufferToEpoch = exports.addInfo = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const defaultDataProp = "data";
|
|
7
|
-
const defaultSamplingRate = 256;
|
|
8
|
-
const isObject = (object) => object instanceof Object && object === Object(object);
|
|
9
|
-
const isFunction = (object) => typeof object === "function";
|
|
10
|
-
const patch = (sample) => (info) => {
|
|
11
|
-
var _a;
|
|
12
|
-
return (Object.assign(Object.assign({}, sample), { info: Object.assign(Object.assign({}, ((_a = sample === null || sample === void 0 ? void 0 : sample.info) !== null && _a !== void 0 ? _a : {})), (info || {})) }));
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Annotates stream with user-defined metadata
|
|
16
|
-
* @method addInfo
|
|
17
|
-
* @example eeg$.pipe(addinfo({ samplingRate: 256, channelNames: ["Af7", "Fp1", "Fp2", "Af8"] })
|
|
18
|
-
* @param {Object} info Info to be added to the EEG stream. Relevant info may include: `samplingRate` and `channelNames`
|
|
19
|
-
* @returns {Observable<Sample|Epoch|PSD>}
|
|
20
|
-
*/
|
|
21
|
-
const addInfo = (infoValue) => (0, rxjs_1.pipe)((0, operators_1.map)((sample) => {
|
|
22
|
-
if (!isObject(sample) ||
|
|
23
|
-
(!isObject(infoValue) && !isFunction(infoValue))) {
|
|
24
|
-
return sample;
|
|
25
|
-
}
|
|
26
|
-
const info = isFunction(infoValue) ? infoValue(sample) : infoValue;
|
|
27
|
-
return patch(sample)(info);
|
|
28
|
-
}));
|
|
29
|
-
exports.addInfo = addInfo;
|
|
30
|
-
/**
|
|
31
|
-
* Get a 2D data array organized by channel from an array of Samples. Credit to Ken from Seattle's elegant transposition
|
|
32
|
-
* http://www.codesuck.com/2012/02/transpose-javascript-array-in-one-line.html
|
|
33
|
-
* @method groupByChannel
|
|
34
|
-
* @param {Array<Sample>} samplesBuffer Array of Samples to be grouped
|
|
35
|
-
* @param {string} [dataProp] Name of the key associated with EEG data
|
|
36
|
-
* @returns {Array<Array<number>>}
|
|
37
|
-
*/
|
|
38
|
-
const groupByChannel = (samplesBuffer, dataProp = defaultDataProp) => samplesBuffer[0][dataProp].map((_, channelIndex) => samplesBuffer.map((sample) => sample[dataProp][channelIndex]));
|
|
39
|
-
/**
|
|
40
|
-
* Takes an array or RxJS buffer of EEG Samples and returns an Epoch.
|
|
41
|
-
* @method bufferToEpoch
|
|
42
|
-
* @example eeg$.pipe(bufferTime(1000), bufferToEpoch({ samplingRate: 256 }))
|
|
43
|
-
*
|
|
44
|
-
* @param {Object} options - Data structure options
|
|
45
|
-
* @param {number} [options.samplingRate] Sampling rate
|
|
46
|
-
* @param {string} [options.dataProp='data'] Name of the key associated with eeg data
|
|
47
|
-
*
|
|
48
|
-
* @returns {Observable<Epoch>}
|
|
49
|
-
*/
|
|
50
|
-
const bufferToEpoch = ({ samplingRate = defaultSamplingRate, dataProp = defaultDataProp } = {}) => (0, rxjs_1.pipe)((0, operators_1.map)((samplesArray) => ({
|
|
51
|
-
[dataProp]: groupByChannel(samplesArray, dataProp),
|
|
52
|
-
info: Object.assign(Object.assign({}, (samplesArray[0] && samplesArray[0].info
|
|
53
|
-
? samplesArray[0].info
|
|
54
|
-
: {})), { startTime: samplesArray[0].timestamp, samplingRate: samplesArray[0].info && samplesArray[0].info.samplingRate
|
|
55
|
-
? samplesArray[0].info.samplingRate
|
|
56
|
-
: samplingRate })
|
|
57
|
-
})));
|
|
58
|
-
exports.bufferToEpoch = bufferToEpoch;
|
|
59
|
-
/**
|
|
60
|
-
* Converts a stream of individual Samples of EEG data into a stream of Epochs of a given duration emitted at specified interval. This operator functions similarly to a circular buffer internally and allows overlapping Epochs of data to be emitted (e.g. emitting the last one second of data every 100ms).
|
|
61
|
-
* @method epoch
|
|
62
|
-
* @example eeg$.pipe(epoch({ duration: 1024, interval: 100, samplingRate: 256 }))
|
|
63
|
-
* @param {Object} options - Epoching options
|
|
64
|
-
* @param {number} [options.duration=256] Number of samples to include in each epoch
|
|
65
|
-
* @param {number} [options.interval=100] Time (ms) between emitted Epochs
|
|
66
|
-
* @param {number} [options.samplingRate=256] Sampling rate
|
|
67
|
-
* @param {string} [options.dataProp='data'] Name of the key associated with eeg data
|
|
68
|
-
* @returns {Observable} Epoch
|
|
69
|
-
*/
|
|
70
|
-
const epoch = ({ duration, interval, samplingRate, dataProp = defaultDataProp }) => (0, rxjs_1.pipe)((0, operators_1.bufferCount)(interval), (0, operators_1.scan)((acc, val) => acc.concat(val).slice(acc.length < duration ? 0 : -duration)), (0, operators_1.filter)((samplesArray) => samplesArray.length === duration), (0, exports.bufferToEpoch)({ samplingRate, dataProp }));
|
|
71
|
-
exports.epoch = epoch;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPlatformHapticMotors = exports.supportsAccel = exports.supportsHaptics = exports.platformConfigByModelVersion = exports.platformFeaturesByModelVersion = exports.HAPTIC_P8 = exports.HAPTIC_P7 = exports.FEATURE_ACCEL = exports.FEATURE_HAPTICS = exports.MODEL_VERSION_3 = exports.MODEL_VERSION_2 = exports.MODEL_VERSION_1 = void 0;
|
|
4
|
-
exports.MODEL_VERSION_1 = "1";
|
|
5
|
-
exports.MODEL_VERSION_2 = "2";
|
|
6
|
-
exports.MODEL_VERSION_3 = "3";
|
|
7
|
-
exports.FEATURE_HAPTICS = "haptics";
|
|
8
|
-
exports.FEATURE_ACCEL = "accel";
|
|
9
|
-
exports.HAPTIC_P7 = "P7";
|
|
10
|
-
exports.HAPTIC_P8 = "P8";
|
|
11
|
-
exports.platformFeaturesByModelVersion = {
|
|
12
|
-
[exports.MODEL_VERSION_1]: [],
|
|
13
|
-
[exports.MODEL_VERSION_2]: [exports.FEATURE_HAPTICS, exports.FEATURE_ACCEL],
|
|
14
|
-
[exports.MODEL_VERSION_3]: [exports.FEATURE_HAPTICS, exports.FEATURE_ACCEL]
|
|
15
|
-
};
|
|
16
|
-
exports.platformConfigByModelVersion = {
|
|
17
|
-
[exports.MODEL_VERSION_1]: {},
|
|
18
|
-
[exports.MODEL_VERSION_2]: {
|
|
19
|
-
motorByMotorName: {
|
|
20
|
-
[exports.HAPTIC_P7]: [],
|
|
21
|
-
[exports.HAPTIC_P8]: []
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
[exports.MODEL_VERSION_3]: {
|
|
25
|
-
motorByMotorName: {
|
|
26
|
-
[exports.HAPTIC_P7]: [],
|
|
27
|
-
[exports.HAPTIC_P8]: []
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const supportsHaptics = (modelVersion) => {
|
|
32
|
-
const platformFeaturesForModel = exports.platformFeaturesByModelVersion[modelVersion];
|
|
33
|
-
return platformFeaturesForModel.includes(exports.FEATURE_HAPTICS);
|
|
34
|
-
};
|
|
35
|
-
exports.supportsHaptics = supportsHaptics;
|
|
36
|
-
const supportsAccel = (modelVersion) => {
|
|
37
|
-
const platformFeaturesForModel = exports.platformFeaturesByModelVersion[modelVersion];
|
|
38
|
-
return platformFeaturesForModel.includes(exports.FEATURE_ACCEL);
|
|
39
|
-
};
|
|
40
|
-
exports.supportsAccel = supportsAccel;
|
|
41
|
-
const getPlatformHapticMotors = (modelVersion) => {
|
|
42
|
-
var _a;
|
|
43
|
-
const platformConfigForModel = exports.platformConfigByModelVersion[modelVersion];
|
|
44
|
-
const platformMotorByMotorName = (_a = platformConfigForModel === null || platformConfigForModel === void 0 ? void 0 : platformConfigForModel.motorByMotorName) !== null && _a !== void 0 ? _a : {};
|
|
45
|
-
return Object.assign({}, platformMotorByMotorName);
|
|
46
|
-
};
|
|
47
|
-
exports.getPlatformHapticMotors = getPlatformHapticMotors;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.validate = exports.isMetricDisallowed = exports.hasInvalidLabels = exports.getLabels = exports.isMetric = void 0;
|
|
27
|
-
const ipk_1 = require("@neurosity/ipk");
|
|
28
|
-
const errors = __importStar(require("../utils/errors"));
|
|
29
|
-
const isMetric = (metric) => Object.keys(ipk_1.metrics).includes(metric);
|
|
30
|
-
exports.isMetric = isMetric;
|
|
31
|
-
const getLabels = (metric) => Object.keys(ipk_1.metrics[metric]);
|
|
32
|
-
exports.getLabels = getLabels;
|
|
33
|
-
const hasInvalidLabels = (metric, labels) => {
|
|
34
|
-
const validLabels = (0, exports.getLabels)(metric);
|
|
35
|
-
return !labels.every((label) => validLabels.includes(label));
|
|
36
|
-
};
|
|
37
|
-
exports.hasInvalidLabels = hasInvalidLabels;
|
|
38
|
-
const isMetricDisallowed = (metricName, options) => "skill" in options &&
|
|
39
|
-
"metrics" in options.skill &&
|
|
40
|
-
!options.skill.metrics.includes(metricName);
|
|
41
|
-
exports.isMetricDisallowed = isMetricDisallowed;
|
|
42
|
-
const validate = (metric, labels, options) => {
|
|
43
|
-
const validLabels = (0, exports.getLabels)(metric).join(", ");
|
|
44
|
-
if (!labels.length) {
|
|
45
|
-
return new Error(`${errors.prefix}At least one label is required for ${metric} metric. Please add one of the following labels: ${validLabels}`);
|
|
46
|
-
}
|
|
47
|
-
if ((0, exports.isMetricDisallowed)(metric, options)) {
|
|
48
|
-
return new Error(`${errors.prefix}No permission to access the ${metric} metric. To access this metric, edit the skill's permissions`);
|
|
49
|
-
}
|
|
50
|
-
if ((0, exports.hasInvalidLabels)(metric, labels)) {
|
|
51
|
-
return new Error(`${errors.prefix}One ore more labels provided to ${metric} are invalid. The valid labels for ${metric} are ${validLabels}`);
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
};
|
|
55
|
-
exports.validate = validate;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare type TransferDeviceByEmail = {
|
|
2
|
-
recipientsEmail: string;
|
|
3
|
-
deviceId: string;
|
|
4
|
-
};
|
|
5
|
-
export declare type TransferDeviceByUserId = {
|
|
6
|
-
recipientsUserId: string;
|
|
7
|
-
deviceId: string;
|
|
8
|
-
};
|
|
9
|
-
export declare type TransferDeviceOptions = TransferDeviceByEmail | TransferDeviceByUserId;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.whileOnline = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
function whileOnline({ status$, allowWhileOnSleepMode }) {
|
|
7
|
-
return (0, rxjs_1.pipe)((0, operators_1.withLatestFrom)(status$), (0, operators_1.mergeMap)(([value, status]) => shouldAllowMetrics(status, allowWhileOnSleepMode)
|
|
8
|
-
? (0, rxjs_1.of)(value)
|
|
9
|
-
: rxjs_1.EMPTY));
|
|
10
|
-
}
|
|
11
|
-
exports.whileOnline = whileOnline;
|
|
12
|
-
function shouldAllowMetrics(status, allowWhileOnSleepMode) {
|
|
13
|
-
return (status.state === "online" &&
|
|
14
|
-
(allowWhileOnSleepMode ? true : !status.sleepMode));
|
|
15
|
-
}
|