@neurosity/sdk 7.0.1 → 7.1.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/examples/node/accelerometer.d.ts +5 -0
- package/dist/examples/node/accelerometer.d.ts.map +1 -0
- package/dist/examples/node/accelerometer.js +12 -0
- package/dist/examples/node/accelerometer.js.map +1 -0
- package/dist/examples/node/authApiKey.d.ts +4 -0
- package/dist/examples/node/authApiKey.d.ts.map +1 -0
- package/dist/examples/node/authApiKey.js +17 -0
- package/dist/examples/node/authApiKey.js.map +1 -0
- package/dist/examples/node/authCustomToken.d.ts +4 -0
- package/dist/examples/node/authCustomToken.d.ts.map +1 -0
- package/dist/examples/node/authCustomToken.js +11 -0
- package/dist/examples/node/authCustomToken.js.map +1 -0
- package/dist/examples/node/authEmailPassword.d.ts +5 -0
- package/dist/examples/node/authEmailPassword.d.ts.map +1 -0
- package/dist/examples/node/authEmailPassword.js +12 -0
- package/dist/examples/node/authEmailPassword.js.map +1 -0
- package/dist/examples/node/authIdToken.d.ts +5 -0
- package/dist/examples/node/authIdToken.d.ts.map +1 -0
- package/dist/examples/node/authIdToken.js +12 -0
- package/dist/examples/node/authIdToken.js.map +1 -0
- package/dist/examples/node/authInheritance.d.ts +5 -0
- package/dist/examples/node/authInheritance.d.ts.map +1 -0
- package/dist/examples/node/authInheritance.js +17 -0
- package/dist/examples/node/authInheritance.js.map +1 -0
- package/dist/examples/node/autoSelectDevice.d.ts +5 -0
- package/dist/examples/node/autoSelectDevice.d.ts.map +1 -0
- package/dist/examples/node/autoSelectDevice.js +16 -0
- package/dist/examples/node/autoSelectDevice.js.map +1 -0
- package/dist/examples/node/brainwaves.d.ts +5 -0
- package/dist/examples/node/brainwaves.d.ts.map +1 -0
- package/dist/examples/node/brainwaves.js +12 -0
- package/dist/examples/node/brainwaves.js.map +1 -0
- package/dist/examples/node/calm.d.ts +5 -0
- package/dist/examples/node/calm.d.ts.map +1 -0
- package/dist/examples/node/calm.js +12 -0
- package/dist/examples/node/calm.js.map +1 -0
- package/dist/examples/node/clients.d.ts +5 -0
- package/dist/examples/node/clients.d.ts.map +1 -0
- package/dist/examples/node/clients.js +10 -0
- package/dist/examples/node/clients.js.map +1 -0
- package/dist/examples/node/createAccount.d.ts +2 -0
- package/dist/examples/node/createAccount.d.ts.map +1 -0
- package/dist/examples/node/createAccount.js +16 -0
- package/dist/examples/node/createAccount.js.map +1 -0
- package/dist/examples/node/createApiKey.d.ts +5 -0
- package/dist/examples/node/createApiKey.d.ts.map +1 -0
- package/dist/examples/node/createApiKey.js +24 -0
- package/dist/examples/node/createApiKey.js.map +1 -0
- package/dist/examples/node/createCustomToken.d.ts +5 -0
- package/dist/examples/node/createCustomToken.d.ts.map +1 -0
- package/dist/examples/node/createCustomToken.js +17 -0
- package/dist/examples/node/createCustomToken.js.map +1 -0
- package/dist/examples/node/deleteAccount.d.ts +2 -0
- package/dist/examples/node/deleteAccount.d.ts.map +1 -0
- package/dist/examples/node/deleteAccount.js +21 -0
- package/dist/examples/node/deleteAccount.js.map +1 -0
- package/dist/examples/node/focus.d.ts +5 -0
- package/dist/examples/node/focus.d.ts.map +1 -0
- package/dist/examples/node/focus.js +12 -0
- package/dist/examples/node/focus.js.map +1 -0
- package/dist/examples/node/getDevices.d.ts +2 -0
- package/dist/examples/node/getDevices.d.ts.map +1 -0
- package/dist/examples/node/getDevices.js +27 -0
- package/dist/examples/node/getDevices.js.map +1 -0
- package/dist/examples/node/haptics.d.ts +5 -0
- package/dist/examples/node/haptics.d.ts.map +1 -0
- package/dist/examples/node/haptics.js +25 -0
- package/dist/examples/node/haptics.js.map +1 -0
- package/dist/examples/node/index.d.ts +2 -0
- package/dist/examples/node/index.d.ts.map +1 -0
- package/dist/examples/node/index.js +62 -0
- package/dist/examples/node/index.js.map +1 -0
- package/dist/examples/node/kinesis.d.ts +5 -0
- package/dist/examples/node/kinesis.d.ts.map +1 -0
- package/dist/examples/node/kinesis.js +12 -0
- package/dist/examples/node/kinesis.js.map +1 -0
- package/dist/examples/node/manuallySelectDevice.d.ts +5 -0
- package/dist/examples/node/manuallySelectDevice.d.ts.map +1 -0
- package/dist/examples/node/manuallySelectDevice.js +18 -0
- package/dist/examples/node/manuallySelectDevice.js.map +1 -0
- package/dist/examples/node/markers.d.ts +5 -0
- package/dist/examples/node/markers.d.ts.map +1 -0
- package/dist/examples/node/markers.js +27 -0
- package/dist/examples/node/markers.js.map +1 -0
- package/dist/examples/node/multipleDevices.d.ts +5 -0
- package/dist/examples/node/multipleDevices.d.ts.map +1 -0
- package/dist/examples/node/multipleDevices.js +33 -0
- package/dist/examples/node/multipleDevices.js.map +1 -0
- package/dist/examples/node/oauth.d.ts +5 -0
- package/dist/examples/node/oauth.d.ts.map +1 -0
- package/dist/examples/node/oauth.js +21 -0
- package/dist/examples/node/oauth.js.map +1 -0
- package/dist/examples/node/osVersion.d.ts +5 -0
- package/dist/examples/node/osVersion.d.ts.map +1 -0
- package/dist/examples/node/osVersion.js +12 -0
- package/dist/examples/node/osVersion.js.map +1 -0
- package/dist/examples/node/predictions.d.ts +5 -0
- package/dist/examples/node/predictions.d.ts.map +1 -0
- package/dist/examples/node/predictions.js +12 -0
- package/dist/examples/node/predictions.js.map +1 -0
- package/dist/examples/node/rawUnfiltered.d.ts +5 -0
- package/dist/examples/node/rawUnfiltered.d.ts.map +1 -0
- package/dist/examples/node/rawUnfiltered.js +12 -0
- package/dist/examples/node/rawUnfiltered.js.map +1 -0
- package/dist/examples/node/removeApiKey.d.ts +5 -0
- package/dist/examples/node/removeApiKey.d.ts.map +1 -0
- package/dist/examples/node/removeApiKey.js +17 -0
- package/dist/examples/node/removeApiKey.js.map +1 -0
- package/dist/examples/node/settings.d.ts +5 -0
- package/dist/examples/node/settings.d.ts.map +1 -0
- package/dist/examples/node/settings.js +19 -0
- package/dist/examples/node/settings.js.map +1 -0
- package/dist/examples/node/signalQuality.d.ts +5 -0
- package/dist/examples/node/signalQuality.d.ts.map +1 -0
- package/dist/examples/node/signalQuality.js +12 -0
- package/dist/examples/node/signalQuality.js.map +1 -0
- package/dist/examples/node/status.d.ts +5 -0
- package/dist/examples/node/status.d.ts.map +1 -0
- package/dist/examples/node/status.js +12 -0
- package/dist/examples/node/status.js.map +1 -0
- package/dist/examples/node/switchSelectedDevice.d.ts +5 -0
- package/dist/examples/node/switchSelectedDevice.d.ts.map +1 -0
- package/dist/examples/node/switchSelectedDevice.js +25 -0
- package/dist/examples/node/switchSelectedDevice.js.map +1 -0
- package/dist/examples/node/timesync.d.ts +5 -0
- package/dist/examples/node/timesync.d.ts.map +1 -0
- package/dist/examples/node/timesync.js +12 -0
- package/dist/examples/node/timesync.js.map +1 -0
- package/dist/examples/node/training.d.ts +5 -0
- package/dist/examples/node/training.d.ts.map +1 -0
- package/dist/examples/node/training.js +30 -0
- package/dist/examples/node/training.js.map +1 -0
- package/dist/examples/node/transferDevice.d.ts +5 -0
- package/dist/examples/node/transferDevice.d.ts.map +1 -0
- package/dist/examples/node/transferDevice.js +27 -0
- package/dist/examples/node/transferDevice.js.map +1 -0
- package/dist/index.js +2151 -964
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2151 -964
- package/dist/index.mjs.map +1 -1
- package/dist/neurosity.iife.js +2151 -964
- package/dist/neurosity.iife.js.map +1 -1
- package/dist/neurosity.umd.js +2151 -964
- package/dist/neurosity.umd.js.map +1 -1
- package/dist/types/Neurosity.d.ts +102 -0
- package/dist/types/Neurosity.d.ts.map +1 -0
- package/dist/types/api/bluetooth/BluetoothClient.d.ts +77 -0
- package/dist/types/api/bluetooth/BluetoothClient.d.ts.map +1 -0
- package/dist/types/api/bluetooth/BluetoothTransport.d.ts +31 -0
- package/dist/types/api/bluetooth/BluetoothTransport.d.ts.map +1 -0
- package/dist/types/api/bluetooth/constants.d.ts +5 -0
- package/dist/types/api/bluetooth/constants.d.ts.map +1 -0
- package/dist/types/api/bluetooth/index.d.ts +6 -0
- package/dist/types/api/bluetooth/index.d.ts.map +1 -0
- package/dist/types/api/bluetooth/react-native/ReactNativeTransport.d.ts +73 -0
- package/dist/types/api/bluetooth/react-native/ReactNativeTransport.d.ts.map +1 -0
- package/dist/types/api/bluetooth/react-native/index.d.ts +3 -0
- package/dist/types/api/bluetooth/react-native/index.d.ts.map +1 -0
- package/dist/types/api/bluetooth/react-native/types/BleManagerTypes.d.ts +64 -0
- package/dist/types/api/bluetooth/react-native/types/BleManagerTypes.d.ts.map +1 -0
- package/dist/types/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +41 -0
- package/dist/types/api/bluetooth/react-native/types/ReactNativeTypes.d.ts.map +1 -0
- package/dist/types/api/bluetooth/react-native/types/index.d.ts +3 -0
- package/dist/types/api/bluetooth/react-native/types/index.d.ts.map +1 -0
- package/dist/types/api/bluetooth/types/index.d.ts +21 -0
- package/dist/types/api/bluetooth/types/index.d.ts.map +1 -0
- package/dist/types/api/bluetooth/utils/binaryBufferToEpoch.d.ts +10 -0
- package/dist/types/api/bluetooth/utils/binaryBufferToEpoch.d.ts.map +1 -0
- package/dist/types/api/bluetooth/utils/create6DigitPin.d.ts +2 -0
- package/dist/types/api/bluetooth/utils/create6DigitPin.d.ts.map +1 -0
- package/dist/types/api/bluetooth/utils/csvBufferToEpoch.d.ts +6 -0
- package/dist/types/api/bluetooth/utils/csvBufferToEpoch.d.ts.map +1 -0
- package/dist/types/api/bluetooth/utils/decodeJSONChunks.d.ts +10 -0
- package/dist/types/api/bluetooth/utils/decodeJSONChunks.d.ts.map +1 -0
- package/dist/types/api/bluetooth/utils/osHasBluetoothSupport.d.ts +3 -0
- package/dist/types/api/bluetooth/utils/osHasBluetoothSupport.d.ts.map +1 -0
- package/dist/types/api/bluetooth/utils/stitch.d.ts +6 -0
- package/dist/types/api/bluetooth/utils/stitch.d.ts.map +1 -0
- package/dist/types/api/bluetooth/utils/textCodec.d.ts +11 -0
- package/dist/types/api/bluetooth/utils/textCodec.d.ts.map +1 -0
- package/dist/types/api/bluetooth/web/WebBluetoothTransport.d.ts +48 -0
- package/dist/types/api/bluetooth/web/WebBluetoothTransport.d.ts.map +1 -0
- package/dist/types/api/bluetooth/web/isMaybeWebWorkerContext.d.ts +2 -0
- package/dist/types/api/bluetooth/web/isMaybeWebWorkerContext.d.ts.map +1 -0
- package/dist/types/api/bluetooth/web/isWebBluetoothSupported.d.ts +2 -0
- package/dist/types/api/bluetooth/web/isWebBluetoothSupported.d.ts.map +1 -0
- package/dist/types/api/firebase/FirebaseApp.d.ts +13 -0
- package/dist/types/api/firebase/FirebaseApp.d.ts.map +1 -0
- package/dist/types/api/firebase/FirebaseDevice.d.ts +35 -0
- package/dist/types/api/firebase/FirebaseDevice.d.ts.map +1 -0
- package/dist/types/api/firebase/FirebaseUser.d.ts +50 -0
- package/dist/types/api/firebase/FirebaseUser.d.ts.map +1 -0
- package/dist/types/api/firebase/config.d.ts +9 -0
- package/dist/types/api/firebase/config.d.ts.map +1 -0
- package/dist/types/api/firebase/deviceStore.d.ts +24 -0
- package/dist/types/api/firebase/deviceStore.d.ts.map +1 -0
- package/dist/types/api/firebase/index.d.ts +4 -0
- package/dist/types/api/firebase/index.d.ts.map +1 -0
- package/dist/types/api/https/config.d.ts +2 -0
- package/dist/types/api/https/config.d.ts.map +1 -0
- package/dist/types/api/https/createOAuthURL.d.ts +4 -0
- package/dist/types/api/https/createOAuthURL.d.ts.map +1 -0
- package/dist/types/api/https/getOAuthToken.d.ts +4 -0
- package/dist/types/api/https/getOAuthToken.d.ts.map +1 -0
- package/dist/types/api/https/utils.d.ts +3 -0
- package/dist/types/api/https/utils.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +74 -0
- package/dist/types/api/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/subscriptions/SubscriptionManager.d.ts +9 -0
- package/dist/types/subscriptions/SubscriptionManager.d.ts.map +1 -0
- package/dist/types/timesync/Timesync.d.ts +21 -0
- package/dist/types/timesync/Timesync.d.ts.map +1 -0
- package/dist/types/timesync/index.d.ts +2 -0
- package/dist/types/timesync/index.d.ts.map +1 -0
- package/dist/types/types/accelerometer.d.ts +12 -0
- package/dist/types/types/accelerometer.d.ts.map +1 -0
- package/dist/types/types/actions.d.ts +11 -0
- package/dist/types/types/actions.d.ts.map +1 -0
- package/dist/types/types/apiKey.d.ts +31 -0
- package/dist/types/types/apiKey.d.ts.map +1 -0
- package/dist/types/types/awareness.d.ts +2 -0
- package/dist/types/types/awareness.d.ts.map +1 -0
- package/dist/types/types/brainwaves.d.ts +40 -0
- package/dist/types/types/brainwaves.d.ts.map +1 -0
- package/dist/types/types/calm.d.ts +7 -0
- package/dist/types/types/calm.d.ts.map +1 -0
- package/dist/types/types/client.d.ts +20 -0
- package/dist/types/types/client.d.ts.map +1 -0
- package/dist/types/types/credentials.d.ts +16 -0
- package/dist/types/types/credentials.d.ts.map +1 -0
- package/dist/types/types/deviceInfo.d.ts +20 -0
- package/dist/types/types/deviceInfo.d.ts.map +1 -0
- package/dist/types/types/epoch.d.ts +10 -0
- package/dist/types/types/epoch.d.ts.map +1 -0
- package/dist/types/types/experiment.d.ts +10 -0
- package/dist/types/types/experiment.d.ts.map +1 -0
- package/dist/types/types/focus.d.ts +7 -0
- package/dist/types/types/focus.d.ts.map +1 -0
- package/dist/types/types/hapticEffects.d.ts +126 -0
- package/dist/types/types/hapticEffects.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +27 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/kinesis.d.ts +7 -0
- package/dist/types/types/kinesis.d.ts.map +1 -0
- package/dist/types/types/marker.d.ts +5 -0
- package/dist/types/types/marker.d.ts.map +1 -0
- package/dist/types/types/metrics.d.ts +13 -0
- package/dist/types/types/metrics.d.ts.map +1 -0
- package/dist/types/types/oauth.d.ts +21 -0
- package/dist/types/types/oauth.d.ts.map +1 -0
- package/dist/types/types/options.d.ts +25 -0
- package/dist/types/types/options.d.ts.map +1 -0
- package/dist/types/types/recording.d.ts +26 -0
- package/dist/types/types/recording.d.ts.map +1 -0
- package/dist/types/types/sample.d.ts +10 -0
- package/dist/types/types/sample.d.ts.map +1 -0
- package/dist/types/types/settings.d.ts +8 -0
- package/dist/types/types/settings.d.ts.map +1 -0
- package/dist/types/types/signalQuality.d.ts +9 -0
- package/dist/types/types/signalQuality.d.ts.map +1 -0
- package/dist/types/types/signalQualityV2.d.ts +14 -0
- package/dist/types/types/signalQualityV2.d.ts.map +1 -0
- package/dist/types/types/skill.d.ts +45 -0
- package/dist/types/types/skill.d.ts.map +1 -0
- package/dist/types/types/status.d.ts +21 -0
- package/dist/types/types/status.d.ts.map +1 -0
- package/dist/types/types/streaming.d.ts +10 -0
- package/dist/types/types/streaming.d.ts.map +1 -0
- package/dist/types/types/subscriptions.d.ts +15 -0
- package/dist/types/types/subscriptions.d.ts.map +1 -0
- package/dist/types/types/training.d.ts +14 -0
- package/dist/types/types/training.d.ts.map +1 -0
- package/dist/types/types/user.d.ts +10 -0
- package/dist/types/types/user.d.ts.map +1 -0
- package/dist/types/utils/errors.d.ts +6 -0
- package/dist/types/utils/errors.d.ts.map +1 -0
- package/dist/types/utils/filterInternalKeys.d.ts +4 -0
- package/dist/types/utils/filterInternalKeys.d.ts.map +1 -0
- package/dist/types/utils/hapticEffects.d.ts +124 -0
- package/dist/types/utils/hapticEffects.d.ts.map +1 -0
- package/dist/types/utils/heartbeat.d.ts +5 -0
- package/dist/types/utils/heartbeat.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +14 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/is-node.d.ts +2 -0
- package/dist/types/utils/is-node.d.ts.map +1 -0
- package/dist/types/utils/metrics.d.ts +4 -0
- package/dist/types/utils/metrics.d.ts.map +1 -0
- package/dist/types/utils/permissions.d.ts +16 -0
- package/dist/types/utils/permissions.d.ts.map +1 -0
- package/dist/types/utils/pick.d.ts +2 -0
- package/dist/types/utils/pick.d.ts.map +1 -0
- package/dist/types/utils/pipes.d.ts +18 -0
- package/dist/types/utils/pipes.d.ts.map +1 -0
- package/dist/types/utils/platform.d.ts +31 -0
- package/dist/types/utils/platform.d.ts.map +1 -0
- package/dist/types/utils/subscription.d.ts +7 -0
- package/dist/types/utils/subscription.d.ts.map +1 -0
- package/dist/types/utils/transferDevice.d.ts +10 -0
- package/dist/types/utils/transferDevice.d.ts.map +1 -0
- package/dist/types/utils/whileOnline.d.ts +9 -0
- package/dist/types/utils/whileOnline.d.ts.map +1 -0
- package/package.json +9 -9
- package/dist/index.d.ts +0 -1067
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accelerometer.d.ts","sourceRoot":"","sources":["accelerometer.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAWA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
email: email,
|
|
6
|
+
password: password
|
|
7
|
+
});
|
|
8
|
+
neurosity.accelerometer().subscribe((accelerometer) => {
|
|
9
|
+
console.log("accelerometer", accelerometer);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=accelerometer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accelerometer.js","sourceRoot":"","sources":["accelerometer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,SAAS,CAAC,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE;QACpD,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authApiKey.d.ts","sourceRoot":"","sources":["authApiKey.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,iBAkB5D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ apiKey }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
neurosity.onUserClaimsChange().subscribe((userClaims) => {
|
|
5
|
+
console.log("userClaims", userClaims);
|
|
6
|
+
});
|
|
7
|
+
await neurosity.login({
|
|
8
|
+
apiKey: apiKey
|
|
9
|
+
});
|
|
10
|
+
neurosity.status().subscribe((status) => {
|
|
11
|
+
console.log("status", status);
|
|
12
|
+
});
|
|
13
|
+
neurosity.calm().subscribe((calm) => {
|
|
14
|
+
console.log("calm", calm);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=authApiKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authApiKey.js","sourceRoot":"","sources":["authApiKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAAE,MAAM,EAAsB;IAC3D,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,SAAS,CAAC,kBAAkB,EAAE,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;QACtD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,MAAM,EAAE,MAAM;KACf,CAAC,CAAC;IAEH,SAAS,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;QAClC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authCustomToken.d.ts","sourceRoot":"","sources":["authCustomToken.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,iBAUtE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ customToken }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
customToken: customToken
|
|
6
|
+
});
|
|
7
|
+
neurosity.status().subscribe((status) => {
|
|
8
|
+
console.log("status", status);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=authCustomToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authCustomToken.js","sourceRoot":"","sources":["authCustomToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAAE,WAAW,EAA2B;IACrE,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,WAAW,EAAE,WAAW;KACzB,CAAC,CAAC;IAEH,SAAS,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authEmailPassword.d.ts","sourceRoot":"","sources":["authEmailPassword.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAWA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
email: email,
|
|
6
|
+
password: password
|
|
7
|
+
});
|
|
8
|
+
neurosity.status().subscribe((status) => {
|
|
9
|
+
console.log("status", status);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=authEmailPassword.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authEmailPassword.js","sourceRoot":"","sources":["authEmailPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,SAAS,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authIdToken.d.ts","sourceRoot":"","sources":["authIdToken.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,OAAO,EACP,UAAU,EACX,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,iBAWA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ idToken, providerId }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
idToken,
|
|
6
|
+
providerId
|
|
7
|
+
});
|
|
8
|
+
neurosity.status().subscribe((status) => {
|
|
9
|
+
console.log("status", status);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=authIdToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authIdToken.js","sourceRoot":"","sources":["authIdToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,OAAO,EACP,UAAU,EAIX;IACC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,OAAO;QACP,UAAU;KACX,CAAC,CAAC;IAEH,SAAS,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authInheritance.d.ts","sourceRoot":"","sources":["authInheritance.ts"],"names":[],"mappings":"AAUA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAeA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
import { config } from "../../src/api/firebase/config";
|
|
3
|
+
import { initializeApp } from "firebase/app";
|
|
4
|
+
import { getAuth, onAuthStateChanged, signInWithEmailAndPassword } from "firebase/auth";
|
|
5
|
+
export default async function ({ email, password }) {
|
|
6
|
+
initializeApp(config);
|
|
7
|
+
onAuthStateChanged(getAuth(), (user) => {
|
|
8
|
+
console.log("app user", user ? user.uid : null);
|
|
9
|
+
});
|
|
10
|
+
const neurosity = new Neurosity();
|
|
11
|
+
await signInWithEmailAndPassword(getAuth(), email, password);
|
|
12
|
+
// Neurosity login is not required since a previously
|
|
13
|
+
// defined neurosity firebase app is used for Neurosity
|
|
14
|
+
const devices = await neurosity.getDevices();
|
|
15
|
+
console.log("devices", devices);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=authInheritance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authInheritance.js","sourceRoot":"","sources":["authInheritance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,aAAa,CAAC,MAAM,CAAC,CAAC;IAEtB,kBAAkB,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;QACrC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,0BAA0B,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAE7D,qDAAqD;IACrD,uDAAuD;IACvD,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,UAAU,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoSelectDevice.d.ts","sourceRoot":"","sources":["autoSelectDevice.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAiBA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
// Note: when deviceId is not passed,
|
|
4
|
+
// Neurosity will auto select the first claimed device
|
|
5
|
+
const neurosity = new Neurosity();
|
|
6
|
+
const response = await neurosity.login({
|
|
7
|
+
email: email,
|
|
8
|
+
password: password
|
|
9
|
+
});
|
|
10
|
+
console.log("response", response);
|
|
11
|
+
neurosity.status().subscribe((status) => {
|
|
12
|
+
console.log("status", status);
|
|
13
|
+
});
|
|
14
|
+
await neurosity.logout();
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=autoSelectDevice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoSelectDevice.js","sourceRoot":"","sources":["autoSelectDevice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,qCAAqC;IACrC,sDAAsD;IACtD,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC;QACrC,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAElC,SAAS,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brainwaves.d.ts","sourceRoot":"","sources":["brainwaves.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAWA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
email: email,
|
|
6
|
+
password: password
|
|
7
|
+
});
|
|
8
|
+
neurosity.brainwaves("raw").subscribe((brainwaves) => {
|
|
9
|
+
console.log("brainwaves", brainwaves);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=brainwaves.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brainwaves.js","sourceRoot":"","sources":["brainwaves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;QACnD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calm.d.ts","sourceRoot":"","sources":["calm.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAWA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
email: email,
|
|
6
|
+
password: password
|
|
7
|
+
});
|
|
8
|
+
neurosity.calm().subscribe((calm) => {
|
|
9
|
+
console.log("calm", calm);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=calm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calm.js","sourceRoot":"","sources":["calm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,SAAS,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;QAClC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["clients.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAUA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
const client1 = new Neurosity();
|
|
4
|
+
await client1.login({ email, password });
|
|
5
|
+
setTimeout(async () => {
|
|
6
|
+
const client2 = new Neurosity();
|
|
7
|
+
await client2.login({ email, password });
|
|
8
|
+
}, 2000);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=clients.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.js","sourceRoot":"","sources":["clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,OAAO,GAAG,IAAI,SAAS,EAAE,CAAC;IAEhC,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEzC,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,OAAO,GAAG,IAAI,SAAS,EAAE,CAAC;QAEhC,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC3C,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAccount.d.ts","sourceRoot":"","sources":["createAccount.ts"],"names":[],"mappings":"AAEA,0CAkBC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function () {
|
|
3
|
+
const neurosity = new Neurosity({
|
|
4
|
+
// important to set `autoSelectDevice` to false when creating an account
|
|
5
|
+
// since there will be no devices to select from
|
|
6
|
+
autoSelectDevice: false
|
|
7
|
+
});
|
|
8
|
+
neurosity.onAuthStateChanged().subscribe((user) => {
|
|
9
|
+
console.log("onAuthStateChanged", user ? `logged in as ${user.email}` : "not logged in");
|
|
10
|
+
});
|
|
11
|
+
await neurosity.createAccount({
|
|
12
|
+
email: `tester+neurosity+${Math.random()}@neurosity.co`,
|
|
13
|
+
password: `${Math.random()}`
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=createAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAccount.js","sourceRoot":"","sources":["createAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK;IAClB,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC;QAC9B,wEAAwE;QACxE,gDAAgD;QAChD,gBAAgB,EAAE,KAAK;KACxB,CAAC,CAAC;IAEH,SAAS,CAAC,kBAAkB,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;QAChD,OAAO,CAAC,GAAG,CACT,oBAAoB,EACpB,IAAI,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,eAAe,CACtD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,CAAC,aAAa,CAAC;QAC5B,KAAK,EAAE,oBAAoB,IAAI,CAAC,MAAM,EAAE,eAAe;QACvD,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE;KAC7B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createApiKey.d.ts","sourceRoot":"","sources":["createApiKey.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAuBA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
email: email,
|
|
6
|
+
password: password
|
|
7
|
+
});
|
|
8
|
+
neurosity
|
|
9
|
+
.createApiKey({
|
|
10
|
+
description: "API Key for custom app",
|
|
11
|
+
scopes: {
|
|
12
|
+
"read:devices-info": true,
|
|
13
|
+
"read:devices-status": true,
|
|
14
|
+
"read:focus": true
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
.then((response) => {
|
|
18
|
+
console.log("success", response);
|
|
19
|
+
})
|
|
20
|
+
.catch((error) => {
|
|
21
|
+
console.log(error);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=createApiKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createApiKey.js","sourceRoot":"","sources":["createApiKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,SAAS;SACN,YAAY,CAAC;QACZ,WAAW,EAAE,wBAAwB;QACrC,MAAM,EAAE;YACN,mBAAmB,EAAE,IAAI;YACzB,qBAAqB,EAAE,IAAI;YAC3B,YAAY,EAAE,IAAI;SACnB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QACjB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCustomToken.d.ts","sourceRoot":"","sources":["createCustomToken.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAgBA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
email: email,
|
|
6
|
+
password: password
|
|
7
|
+
});
|
|
8
|
+
neurosity
|
|
9
|
+
.createCustomToken()
|
|
10
|
+
.then((token) => {
|
|
11
|
+
console.log("success", token);
|
|
12
|
+
})
|
|
13
|
+
.catch((error) => {
|
|
14
|
+
console.log(error);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=createCustomToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCustomToken.js","sourceRoot":"","sources":["createCustomToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,SAAS;SACN,iBAAiB,EAAE;SACnB,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteAccount.d.ts","sourceRoot":"","sources":["deleteAccount.ts"],"names":[],"mappings":"AAEA,0CA4BC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function () {
|
|
3
|
+
const neurosity = new Neurosity({
|
|
4
|
+
// important to set `autoSelectDevice` to false when creating an account
|
|
5
|
+
// since there will be no devices to select from
|
|
6
|
+
autoSelectDevice: false
|
|
7
|
+
});
|
|
8
|
+
neurosity.onAuthStateChanged().subscribe((user) => {
|
|
9
|
+
console.log("onAuthStateChanged", user ? `logged in as ${user.email}` : "not logged in");
|
|
10
|
+
});
|
|
11
|
+
const email = `tester+neurosity+${Math.random()}@neurosity.co`;
|
|
12
|
+
await neurosity.createAccount({
|
|
13
|
+
email,
|
|
14
|
+
password: `${Math.random()}`
|
|
15
|
+
});
|
|
16
|
+
console.log("account created");
|
|
17
|
+
await new Promise((r) => setTimeout(r, 10000));
|
|
18
|
+
await neurosity.deleteAccount();
|
|
19
|
+
console.log("account deleted");
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=deleteAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteAccount.js","sourceRoot":"","sources":["deleteAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK;IAClB,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC;QAC9B,wEAAwE;QACxE,gDAAgD;QAChD,gBAAgB,EAAE,KAAK;KACxB,CAAC,CAAC;IAEH,SAAS,CAAC,kBAAkB,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;QAChD,OAAO,CAAC,GAAG,CACT,oBAAoB,EACpB,IAAI,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,eAAe,CACtD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,oBAAoB,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;IAE/D,MAAM,SAAS,CAAC,aAAa,CAAC;QAC5B,KAAK;QACL,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE;KAC7B,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAE/B,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAE/C,MAAM,SAAS,CAAC,aAAa,EAAE,CAAC;IAEhC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["focus.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAWA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
email: email,
|
|
6
|
+
password: password
|
|
7
|
+
});
|
|
8
|
+
neurosity.focus().subscribe((focus) => {
|
|
9
|
+
console.log("focus", focus);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=focus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus.js","sourceRoot":"","sources":["focus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;QACpC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDevices.d.ts","sourceRoot":"","sources":["getDevices.ts"],"names":[],"mappings":"AAEA,0CA2BC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function () {
|
|
3
|
+
// Note: when `deviceId` is not passed, and `autoSelectDevice`
|
|
4
|
+
// is set to not set (defaults to true), the first claimed
|
|
5
|
+
// device will be automatically selected.
|
|
6
|
+
const neurosity = new Neurosity();
|
|
7
|
+
neurosity.onUserDevicesChange().subscribe((devices) => {
|
|
8
|
+
console.log("devices", devices);
|
|
9
|
+
});
|
|
10
|
+
await neurosity
|
|
11
|
+
.login({
|
|
12
|
+
email: process.env.NEUROSITY_EMAIL,
|
|
13
|
+
password: process.env.NEUROSITY_PASSWORD
|
|
14
|
+
})
|
|
15
|
+
.catch((error) => {
|
|
16
|
+
console.log("error", error);
|
|
17
|
+
});
|
|
18
|
+
neurosity
|
|
19
|
+
.getDevices()
|
|
20
|
+
.then((devices) => {
|
|
21
|
+
console.log("devices (once)", devices);
|
|
22
|
+
})
|
|
23
|
+
.catch((error) => {
|
|
24
|
+
console.error("devices catch", error);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=getDevices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDevices.js","sourceRoot":"","sources":["getDevices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK;IAClB,8DAA8D;IAC9D,0DAA0D;IAC1D,yCAAyC;IACzC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,SAAS,CAAC,mBAAmB,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE;QACpD,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS;SACZ,KAAK,CAAC;QACL,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,eAAgB;QACnC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAmB;KAC1C,CAAC;SACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEL,SAAS;SACN,UAAU,EAAE;SACZ,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAChB,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haptics.d.ts","sourceRoot":"","sources":["haptics.ts"],"names":[],"mappings":"AAEA,yBAA+B,EAC7B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,iBA0BA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Neurosity } from "../../src/index";
|
|
2
|
+
export default async function ({ email, password }) {
|
|
3
|
+
const neurosity = new Neurosity();
|
|
4
|
+
await neurosity.login({
|
|
5
|
+
email: email,
|
|
6
|
+
password: password
|
|
7
|
+
});
|
|
8
|
+
const info = await neurosity.getInfo();
|
|
9
|
+
console.log("info", info);
|
|
10
|
+
const effects = neurosity.getHapticEffects();
|
|
11
|
+
const hapticOptions = {
|
|
12
|
+
P7: [effects.strongClick100],
|
|
13
|
+
P8: [
|
|
14
|
+
effects.transitionRampUpLongSmooth1_0_to_100,
|
|
15
|
+
effects.transitionRampDownLongSmooth1_100_to_0,
|
|
16
|
+
effects.transitionRampUpLongSmooth1_0_to_100,
|
|
17
|
+
effects.transitionRampDownLongSmooth1_100_to_0,
|
|
18
|
+
effects.transitionRampUpLongSmooth1_0_to_100,
|
|
19
|
+
effects.transitionRampDownLongSmooth1_100_to_0
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
const res = await neurosity.haptics(hapticOptions);
|
|
23
|
+
console.log("Res", res);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=haptics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haptics.js","sourceRoot":"","sources":["haptics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,EAC7B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,MAAM,SAAS,CAAC,KAAK,CAAC;QACpB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE1B,MAAM,OAAO,GAAG,SAAS,CAAC,gBAAgB,EAAE,CAAC;IAC7C,MAAM,aAAa,GAAG;QACpB,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC;QAC5B,EAAE,EAAE;YACF,OAAO,CAAC,oCAAoC;YAC5C,OAAO,CAAC,sCAAsC;YAC9C,OAAO,CAAC,oCAAoC;YAC5C,OAAO,CAAC,sCAAsC;YAC9C,OAAO,CAAC,oCAAoC;YAC5C,OAAO,CAAC,sCAAsC;SAC/C;KACF,CAAC;IAEF,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { config } from "dotenv";
|
|
2
|
+
import inquirer from "inquirer";
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
config();
|
|
5
|
+
const deviceId = process.env.NEUROSITY_DEVICE_ID;
|
|
6
|
+
const email = process.env.NEUROSITY_EMAIL;
|
|
7
|
+
const password = process.env.NEUROSITY_PASSWORD;
|
|
8
|
+
const customToken = process.env.NEUROSITY_CUSTOM_TOKEN;
|
|
9
|
+
const idToken = process.env.NEUROSITY_ID_TOKEN;
|
|
10
|
+
const providerId = process.env.NEUROSITY_PROVIDER_ID;
|
|
11
|
+
const apiKey = process.env.NEUROSITY_API_KEY;
|
|
12
|
+
const choiceName = process.argv[2];
|
|
13
|
+
const fileExtension = ".ts";
|
|
14
|
+
console.log("email -> ", email);
|
|
15
|
+
console.log("password -> ", password);
|
|
16
|
+
console.log("deviceId -> ", deviceId);
|
|
17
|
+
console.log("customToken -> ", customToken);
|
|
18
|
+
console.log("idToken -> ", idToken);
|
|
19
|
+
console.log("providerId -> ", providerId);
|
|
20
|
+
console.log("apiKey -> ", apiKey);
|
|
21
|
+
const choices = fs
|
|
22
|
+
.readdirSync("./examples/node")
|
|
23
|
+
.filter((fileName) => fileName !== `index${fileExtension}`);
|
|
24
|
+
if (choices
|
|
25
|
+
.map((choice) => choice.replace(fileExtension, ""))
|
|
26
|
+
.includes(choiceName)) {
|
|
27
|
+
const exampleFileName = `${choiceName}${fileExtension}`;
|
|
28
|
+
runFile(exampleFileName).catch((error) => {
|
|
29
|
+
console.log("runFile error -> ", error);
|
|
30
|
+
});
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
const questions = [
|
|
34
|
+
{
|
|
35
|
+
type: "list",
|
|
36
|
+
name: "exampleFileName",
|
|
37
|
+
message: `Select an example to run`,
|
|
38
|
+
choices
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
// @ts-expect-error - not clear why the type is not right
|
|
42
|
+
inquirer.prompt(questions).then(async ({ exampleFileName }) => {
|
|
43
|
+
runFile(exampleFileName).catch((error) => {
|
|
44
|
+
console.log("runFile error -> ", error);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
async function runFile(exampleFileName) {
|
|
48
|
+
const { default: exampleFunction } = await import(`./${exampleFileName}`);
|
|
49
|
+
if (typeof exampleFunction !== "function") {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await exampleFunction({
|
|
53
|
+
email,
|
|
54
|
+
password,
|
|
55
|
+
customToken,
|
|
56
|
+
apiKey,
|
|
57
|
+
deviceId,
|
|
58
|
+
idToken,
|
|
59
|
+
providerId
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=index.js.map
|