@byhealth/data-reporter
Advanced tools
Comparing version 1.0.0-beta.4 to 1.0.0-beta.5
'use strict'; | ||
var nanoid = require('nanoid'); | ||
var flatted = require('flatted'); | ||
var nonSecure = require('nanoid/non-secure'); | ||
var flatted = require('flatted'); | ||
@@ -12,3 +13,3 @@ /* | ||
const config = { | ||
SDK_VERSION: "1.0.0-beta.4", | ||
SDK_VERSION: "1.0.0-beta.5", | ||
DEBUG: false, | ||
@@ -191,3 +192,3 @@ API_URL: 'https://trk.by-health.com/trk-api/trk/data', | ||
getCid() { | ||
return nonSecure.nanoid(21); | ||
return nanoid.nanoid(21); | ||
} | ||
@@ -197,3 +198,3 @@ getUid() { | ||
if (!id) { | ||
id = nonSecure.nanoid(15); | ||
id = nanoid.nanoid(15); | ||
this._storage.set(UNIQUE_ID, id); | ||
@@ -204,3 +205,3 @@ } | ||
getSid() { | ||
return nonSecure.nanoid(11); | ||
return nanoid.nanoid(11); | ||
} | ||
@@ -361,4 +362,3 @@ } | ||
send({ token, data }) { | ||
return wx | ||
.request({ | ||
return wx.request({ | ||
url: config.API_URL, | ||
@@ -371,4 +371,3 @@ method: 'POST', | ||
data, | ||
}) | ||
.then((res) => res.statusCode >= 200 && res.statusCode <= 299); | ||
}); | ||
} | ||
@@ -386,2 +385,16 @@ } | ||
} | ||
getCid() { | ||
return nonSecure.nanoid(21); | ||
} | ||
getUid() { | ||
let id = this._storage.get(UNIQUE_ID); | ||
if (!id) { | ||
id = nonSecure.nanoid(15); | ||
this._storage.set(UNIQUE_ID, id); | ||
} | ||
return id; | ||
} | ||
getSid() { | ||
return nonSecure.nanoid(11); | ||
} | ||
getOS() { | ||
@@ -388,0 +401,0 @@ if (typeof wx === 'object' && typeof wx.getDeviceInfo === 'function') { |
@@ -183,2 +183,5 @@ interface ClientOptions { | ||
constructor(options: ClientOptions); | ||
protected getCid(): string; | ||
protected getUid(): string; | ||
protected getSid(): string; | ||
protected getOS(): any; | ||
@@ -185,0 +188,0 @@ } |
@@ -1,3 +0,4 @@ | ||
import { nanoid } from 'nanoid/non-secure'; | ||
import { nanoid } from 'nanoid'; | ||
import { fromJSON, toJSON, parse, stringify } from 'flatted'; | ||
import { nanoid as nanoid$1 } from 'nanoid/non-secure'; | ||
@@ -10,3 +11,3 @@ /* | ||
const config = { | ||
SDK_VERSION: "1.0.0-beta.4", | ||
SDK_VERSION: "1.0.0-beta.5", | ||
DEBUG: false, | ||
@@ -356,4 +357,3 @@ API_URL: 'https://trk.by-health.com/trk-api/trk/data', | ||
send({ token, data }) { | ||
return wx | ||
.request({ | ||
return wx.request({ | ||
url: config.API_URL, | ||
@@ -366,4 +366,3 @@ method: 'POST', | ||
data, | ||
}) | ||
.then((res) => res.statusCode >= 200 && res.statusCode <= 299); | ||
}); | ||
} | ||
@@ -381,2 +380,16 @@ } | ||
} | ||
getCid() { | ||
return nanoid$1(21); | ||
} | ||
getUid() { | ||
let id = this._storage.get(UNIQUE_ID); | ||
if (!id) { | ||
id = nanoid$1(15); | ||
this._storage.set(UNIQUE_ID, id); | ||
} | ||
return id; | ||
} | ||
getSid() { | ||
return nanoid$1(11); | ||
} | ||
getOS() { | ||
@@ -383,0 +396,0 @@ if (typeof wx === 'object' && typeof wx.getDeviceInfo === 'function') { |
{ | ||
"name": "@byhealth/data-reporter", | ||
"version": "1.0.0-beta.4", | ||
"version": "1.0.0-beta.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
51325
972