New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nativestudios/creace-core

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nativestudios/creace-core - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

34

lib/api/DeviceApi.js
import DeviceInfo from 'react-native-device-info';
import * as RNLocalize from 'react-native-localize';
import { CreaceConfig } from '../Config';
import { Api } from './Api';
const DEFAULT_DATA = {
id: DeviceInfo.getUniqueID(),
manufacturer: DeviceInfo.getManufacturer(),
model: DeviceInfo.getModel(),
system_name: DeviceInfo.getSystemName(),
system_version: DeviceInfo.getSystemVersion(),
bundleId: DeviceInfo.getBundleId(),
version: DeviceInfo.getReadableVersion(),
locale: DeviceInfo.getDeviceLocale().toLowerCase(),
country: DeviceInfo.getDeviceCountry().toUpperCase(),
push_token: null
};
class _DeviceApi extends Api {
async getDefaultData() {
const locales = RNLocalize.getLocales();
const locale = !locales.length ? 'en' : locales[0].languageCode;
return {
id: await DeviceInfo.getUniqueId(),
manufacturer: await DeviceInfo.getManufacturer(),
model: await DeviceInfo.getModel(),
system_name: await DeviceInfo.getSystemName(),
system_version: await DeviceInfo.getSystemVersion(),
bundle_id: await DeviceInfo.getSystemVersion(),
version: await DeviceInfo.getReadableVersion(),
locale: locale,
country: RNLocalize.getCountry().toUpperCase()
};
}
async register(data = {}) {
const device = Object.assign({}, DEFAULT_DATA, data);
const defaultData = await this.getDefaultData();
const device = Object.assign({}, defaultData, data);
device.locale = device.locale.split('-')[0];

@@ -27,3 +33,3 @@ const body = {

system_version: device.system_version,
bundle_id: device.bundleId,
bundle_id: device.bundle_id,
version: device.version,

@@ -30,0 +36,0 @@ locale: device.locale,

{
"name": "@nativestudios/creace-core",
"version": "0.0.14",
"version": "0.0.15",
"description": "Creace Core",

@@ -31,3 +31,4 @@ "keywords": [

"react-native": "*",
"react-native-device-info": "*",
"react-native-device-info": "^3.0.0",
"react-native-localize": "^1.2.0",
"rn-fetch-blob": "*"

@@ -40,3 +41,3 @@ },

},
"gitHead": "8a3cc43ddca626e818896306ff000a97f5063078"
"gitHead": "deddd5f825a636e5d1190470dfa2e3233ff36443"
}

@@ -8,3 +8,3 @@ // @flow

system_version: string;
bundleId: string;
bundle_id: string;
version: string;

@@ -11,0 +11,0 @@ locale: string;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc