New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@parkingboss/api

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parkingboss/api - npm Package Compare versions

Comparing version
1.4.0
to
2.0.0
+2
-17
dist/cjs/api/base.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.apiBase = void 0;
const BASE_LINK_QUERY = "link[rel~='index'][rel~='api'][type~='application/json']";
function apiBaseLink() {
const link = document.querySelector(BASE_LINK_QUERY);
if (!link) {
throw new Error(`No <${BASE_LINK_QUERY}> found!`);
}
return link;
}
function apiBase() {
const link = apiBaseLink();
const link = new URL("https://api.propertyboss.io/v2");
return {
subscribe(fn) {
fn(link.href);
const observer = new MutationObserver(muts => {
muts.forEach(mut => {
if (mut.attributeName === 'href')
fn(link.href);
});
});
observer.observe(link, { attributes: true });
return () => observer.disconnect();
return () => { };
},

@@ -26,0 +11,0 @@ set(val) {

@@ -1,2 +0,1 @@

import { BaseWatcher } from "./base";
import { User } from "./loadUser";

@@ -14,3 +13,2 @@ import { SessionControl } from "./session";

apiBase: string;
baseStore: BaseWatcher;
}

@@ -17,0 +15,0 @@ export interface CoreApi {

+4
-5

@@ -8,3 +8,2 @@ "use strict";

function optsToSettings(opts) {
const baseStore = base_1.apiBase();
const settings = {

@@ -14,7 +13,7 @@ client: opts.client,

apiBase: opts.apiBase || "TEMP_FAKE",
baseStore,
};
baseStore.subscribe((newBase) => {
settings.apiBase = opts.apiBase ?? newBase;
});
if (!opts.apiBase) {
const watcher = base_1.apiBase();
watcher.subscribe((newBase) => (settings.apiBase = newBase));
}
return settings;

@@ -21,0 +20,0 @@ }

@@ -18,3 +18,3 @@ "use strict";

const opts = maybeOpt || (isUrlLike(urlOrOpt) ? {} : urlOrOpt);
const url = new URL(urlArg.toString(), document.baseURI);
const url = new URL(urlArg.toString(), "https://api.propertyboss.io/v2");
Object.entries(opts.query || {}).forEach(([key, val]) => {

@@ -21,0 +21,0 @@ if (val) {

@@ -1,22 +0,7 @@

const BASE_LINK_QUERY = "link[rel~='index'][rel~='api'][type~='application/json']";
function apiBaseLink() {
const link = document.querySelector(BASE_LINK_QUERY);
if (!link) {
throw new Error(`No <${BASE_LINK_QUERY}> found!`);
}
return link;
}
export function apiBase() {
const link = apiBaseLink();
const link = new URL("https://api.propertyboss.io/v2");
return {
subscribe(fn) {
fn(link.href);
const observer = new MutationObserver(muts => {
muts.forEach(mut => {
if (mut.attributeName === 'href')
fn(link.href);
});
});
observer.observe(link, { attributes: true });
return () => observer.disconnect();
return () => { };
},

@@ -23,0 +8,0 @@ set(val) {

@@ -1,2 +0,1 @@

import { BaseWatcher } from "./base";
import { User } from "./loadUser";

@@ -14,3 +13,2 @@ import { SessionControl } from "./session";

apiBase: string;
baseStore: BaseWatcher;
}

@@ -17,0 +15,0 @@ export interface CoreApi {

@@ -5,3 +5,2 @@ import { apiBase } from "./base";

function optsToSettings(opts) {
const baseStore = apiBase();
const settings = {

@@ -11,7 +10,7 @@ client: opts.client,

apiBase: opts.apiBase || "TEMP_FAKE",
baseStore,
};
baseStore.subscribe((newBase) => {
settings.apiBase = opts.apiBase ?? newBase;
});
if (!opts.apiBase) {
const watcher = apiBase();
watcher.subscribe((newBase) => (settings.apiBase = newBase));
}
return settings;

@@ -18,0 +17,0 @@ }

@@ -15,3 +15,3 @@ function urlToPath(url, opts = {}) {

const opts = maybeOpt || (isUrlLike(urlOrOpt) ? {} : urlOrOpt);
const url = new URL(urlArg.toString(), document.baseURI);
const url = new URL(urlArg.toString(), "https://api.propertyboss.io/v2");
Object.entries(opts.query || {}).forEach(([key, val]) => {

@@ -18,0 +18,0 @@ if (val) {

{
"name": "@parkingboss/api",
"version": "1.4.0",
"version": "2.0.0",
"description": "The Parking Boss API",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js",

@@ -1,2 +0,2 @@

# Parking Boss API
# DEPRECATED: Parking Boss API

@@ -7,3 +7,3 @@ This package adds managed access to the parking boss API. The API is relatively

```typescript
```ts
import { Api } from "@parkingboss/api";

@@ -19,4 +19,1 @@

```
This package _expects_ to be run in a browser context. Refactoring for node has
is an open TODO.