@goki-lock/react-native
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -1,12 +0,16 @@ | ||
import './polyfill'; | ||
import createGokiLockSDK from "@goki-lock/core"; | ||
import { RNBluetoothConnector } from "./RNBluetoothConnector"; | ||
import { Logger } from "@goki-lock/core"; | ||
export { Logger } from "@goki-lock/core"; | ||
export const GokiLockSDK = createGokiLockSDK({ | ||
connector: new RNBluetoothConnector() | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GokiLockSDK = exports.Logger = void 0; | ||
require("./polyfill"); | ||
const core_1 = __importDefault(require("@goki-lock/core")); | ||
const RNBluetoothConnector_1 = require("./RNBluetoothConnector"); | ||
var core_2 = require("@goki-lock/core"); | ||
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return core_2.Logger; } }); | ||
exports.GokiLockSDK = (0, core_1.default)({ | ||
connector: new RNBluetoothConnector_1.RNBluetoothConnector() | ||
}); | ||
if (__DEV__) | ||
Logger.setLogLevel(Logger.LogLevel.debug); | ||
export default GokiLockSDK; | ||
exports.default = exports.GokiLockSDK; | ||
//# sourceMappingURL=index.js.map |
@@ -1,10 +0,12 @@ | ||
import 'text-encoding-polyfill'; | ||
import { Buffer } from 'buffer'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("text-encoding-polyfill"); | ||
const buffer_1 = require("buffer"); | ||
// @ts-ignore | ||
if (!global.Buffer) { | ||
// @ts-ignore | ||
global['Buffer'] = Buffer; | ||
const originalSubArray = Buffer.prototype.subarray; | ||
Buffer.prototype.subarray = function (...args) { | ||
return Buffer.from(originalSubArray.apply(this, args)); | ||
global['Buffer'] = buffer_1.Buffer; | ||
const originalSubArray = buffer_1.Buffer.prototype.subarray; | ||
buffer_1.Buffer.prototype.subarray = function (...args) { | ||
return buffer_1.Buffer.from(originalSubArray.apply(this, args)); | ||
}; | ||
@@ -11,0 +13,0 @@ } |
@@ -1,4 +0,7 @@ | ||
import { Logger } from "@goki-lock/core"; | ||
import { BleManager } from 'react-native-ble-plx'; | ||
import { Buffer } from "buffer"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RNBluetoothConnector = void 0; | ||
const core_1 = require("@goki-lock/core"); | ||
const react_native_ble_plx_1 = require("react-native-ble-plx"); | ||
const buffer_1 = require("buffer"); | ||
class MyCharacteristic { | ||
@@ -24,3 +27,3 @@ constructor(characteristic) { | ||
if (characteristic === null || characteristic === void 0 ? void 0 : characteristic.value) { | ||
(_a = this.onDataListener) === null || _a === void 0 ? void 0 : _a.call(this, Buffer.from(characteristic.value, 'base64')); | ||
(_a = this.onDataListener) === null || _a === void 0 ? void 0 : _a.call(this, buffer_1.Buffer.from(characteristic.value, 'base64')); | ||
} | ||
@@ -87,7 +90,7 @@ }); | ||
} | ||
export class RNBluetoothConnector { | ||
class RNBluetoothConnector { | ||
constructor() { | ||
this.logger = Logger.withTag("RNBluetoothConnector"); | ||
this.logger = core_1.Logger.withTag("RNBluetoothConnector"); | ||
this.LockServiceUUIDs = ["1910", "00001910-0000-1000-8000-00805f9b34fb"]; | ||
this.bleManager = new BleManager(); | ||
this.bleManager = new react_native_ble_plx_1.BleManager(); | ||
this.peripheralCache = new Map(); | ||
@@ -151,2 +154,3 @@ this.connect = this.connect.bind(this); | ||
} | ||
exports.RNBluetoothConnector = RNBluetoothConnector; | ||
//# sourceMappingURL=RNBluetoothConnector.js.map |
{ | ||
"name": "@goki-lock/react-native", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "goki lock sdk", | ||
@@ -24,4 +24,3 @@ "files": [ | ||
"build": "rm -rf ./lib && tsc -p ./tsconfig.json", | ||
"prepack": "yarn build", | ||
"postinstall": "patch-package" | ||
"prepack": "yarn build" | ||
}, | ||
@@ -32,5 +31,3 @@ "dependencies": { | ||
"buffer": "6.0.3", | ||
"patch-package": "^6.4.7", | ||
"react-native-ble-plx": "2.0.3", | ||
"stream-browserify": "3.0.0", | ||
"text-encoding-polyfill": "0.6.7" | ||
@@ -37,0 +34,0 @@ }, |
@@ -15,2 +15,21 @@ ## Goki lock sdk for react-native | ||
then add the `stream` alias to your metro.config.js | ||
& install `stream-browserify` if needed | ||
```javascript | ||
module.exports = { | ||
// ... | ||
resolver: { | ||
extraNodeModules: { | ||
'stream': require.resolve('stream-browserify'), | ||
}, | ||
}, | ||
//... | ||
} | ||
``` | ||
```js | ||
please follow [react-native-ble-plx@2.+](https://github.com/dotintent/react-native-ble-plx) | ||
@@ -17,0 +36,0 @@ documentation and install it and add the required permissions to your app. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
11644
5
231
68
0
8
- Removedpatch-package@^6.4.7
- Removedstream-browserify@3.0.0
- Removed@yarnpkg/lockfile@1.1.0(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedat-least-node@1.0.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@3.0.3(transitive)
- Removedchalk@4.1.2(transitive)
- Removedci-info@2.0.0(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcross-spawn@6.0.5(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedfind-yarn-workspace-root@2.0.0(transitive)
- Removedfs-extra@9.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedis-ci@2.0.0(transitive)
- Removedis-docker@2.2.1(transitive)
- Removedis-number@7.0.0(transitive)
- Removedis-wsl@2.2.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjsonfile@6.1.0(transitive)
- Removedklaw-sync@6.0.0(transitive)
- Removedmicromatch@4.0.8(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removednice-try@1.0.5(transitive)
- Removedonce@1.4.0(transitive)
- Removedopen@7.4.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedpatch-package@6.5.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedslash@2.0.0(transitive)
- Removedstream-browserify@3.0.0(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedtmp@0.0.33(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removeduniversalify@2.0.1(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedyaml@1.10.2(transitive)