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

senter-apps-service

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

senter-apps-service - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

47

appsService.js

@@ -1,4 +0,4 @@

const MongoRepository = require('senter-mongo-repository');
const MongoRepository = require('senter-mongo-repository')
module.exports = class AppsService {
module.exports = class AppsService {
static get ShopifyName() { return 'shopify'; }

@@ -8,7 +8,6 @@ static get KountaName() { return 'kounta'; }

static get BigcommerceName() { return 'bigCommerce'; }
static get GoogleName() { return 'google'; }
static get FacebookName() { return 'facebook'; }
constructor(client, dbName)
{
static get GoogleName() { return 'google'; }
static get FacebookName() { return 'facebook'; }
constructor(client, dbName) {
this._appRepository = new MongoRepository(client, dbName, MongoRepository.AppsCollectionName);

@@ -18,23 +17,23 @@ this._settingsRepository = new MongoRepository(client, dbName, MongoRepository.SettingsCollectionName);

async getApp(userId, appName){
var apps = await this.getUserAppsDocument(userId);
async getApp(userId, appName) {
var apps = await this.getUserAppsDocument(userId)
return apps[appName]
}
async getApps(userId){
return await this.getUserAppsDocument(userId);
async getApps(userId) {
return await this.getUserAppsDocument(userId)
}
async updateApp(userId, appName, appObject){
var apps = await this.getUserAppsDocument(userId);
async updateApp(userId, appName, appObject) {
var apps = await this.getUserAppsDocument(userId)
apps[appName] = appObject
await this._appRepository.upsert(userId, userId, apps)
}
async deleteApp(userId, appName){
async deleteApp(userId, appName) {
await this.updateApp(userId, appName, undefined)
//remove location in settings
var updateQuery = {$set:{}};
var updateQuery = { $set: {} };
updateQuery.$set[`locations.$[].${appName}`] = null;

@@ -44,13 +43,13 @@ await this._settingsRepository.updateMany({}, userId, updateQuery)

async searchApp(term){
return await this._appRepository.search(term);
async searchApp(term) {
return await this._appRepository.search(term)
}
async getUserAppsDocument(userId) {
const apps = await this._appRepository.getById(userId, userId);
const apps = await this._appRepository.getById(userId, userId)
if (!apps)
return await this._create(userId);
return await this._create(userId)
return apps;
return apps
}

@@ -60,3 +59,3 @@

var apps = {
id: userId
id: userId
}

@@ -63,0 +62,0 @@

{
"name": "senter-apps-service",
"version": "1.0.12",
"version": "1.0.13",
"description": "Keep track of active integration apps",

@@ -12,3 +12,3 @@ "main": "appsService.js",

"dependencies": {
"senter-mongo-repository": "^2.1.0"
"senter-mongo-repository": "^1.3.0"
},

@@ -15,0 +15,0 @@ "devDependencies": {

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