Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aserto/aserto-spa-js

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aserto/aserto-spa-js - npm Package Compare versions

Comparing version 0.1.18 to 0.1.19

21

dist/AsertoClient.js

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

this.defaultMap = options && options.defaultMap || {
visible: true,
enabled: true,
allowed: false
};
if (!options || !options.accessToken) {

@@ -110,11 +116,6 @@ throw new Error('AsertoClient: must provide access token');

var map = this.__accessMap[path] && this.__accessMap[path].verb || {};
var defaultMap = {
visible: false,
enabled: false,
allowed: false
};
map.GET = map.GET || defaultMap;
map.PUT = map.PUT || defaultMap;
map.DELETE = map.DELETE || defaultMap;
map.POST = map.POST || defaultMap;
map.GET = map.GET || this.defaultMap;
map.PUT = map.PUT || this.defaultMap;
map.DELETE = map.DELETE || this.defaultMap;
map.POST = map.POST || this.defaultMap;
return map;

@@ -128,2 +129,2 @@ }

exports["default"] = AsertoClient;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9Bc2VydG9DbGllbnQuanMiXSwibmFtZXMiOlsiVklTSUJMRSIsIkVOQUJMRUQiLCJBTExPV0VEIiwiQXNlcnRvQ2xpZW50Iiwib3B0aW9ucyIsImFjY2Vzc1Rva2VuIiwiRXJyb3IiLCJ0b2tlbiIsImVuZHBvaW50IiwiYWNjZXNzTWFwRW5kcG9pbnQiLCJzZXJ2aWNlIiwic2VydmljZVVybCIsIlVSTCIsIndpbmRvdyIsImxvY2F0aW9uIiwib3JpZ2luIiwicmVzcG9uc2UiLCJlcnJvciIsIm1lc3NhZ2UiLCJqc29uIiwibWFwIiwiX19hY2Nlc3NNYXAiLCJwYXRoIiwidmVyYiIsImRlZmF1bHRNYXAiLCJ2aXNpYmxlIiwiZW5hYmxl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T1NUIHx8IHRoaXMuZGVmYXVsdE1hcDtcbiAgICByZXR1cm4gbWFwO1xuICB9XG59XG4iXX0=
{
"name": "@aserto/aserto-spa-js",
"version": "0.1.18",
"version": "0.1.19",
"description": "Aserto single-page application javascript SDK",

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

@@ -50,3 +50,8 @@ # Aserto single-page application javascript SDK

serviceUrl: 'https://service-url', // defaults to window.location.origin
endpoint: '/__accessmap' // access map endpoint, defaults to /__accessmap
endpoint: '/__accessmap', // access map endpoint, defaults to /__accessmap
defaultMap: { // pass a default map for endpoints that don't expose a map
visible: true, // visible defaults to true
enabled: true, // enabled defaults to true
allowed: false // allowed defaults to false
}
});

@@ -81,3 +86,3 @@

The `path` argument is in the form `/path/to/resource`. It may contain a `{id}` component to indicate an parameter.
The `path` argument is in the form `/path/to/resource`. It may contain a `__id` component to indicate an parameter - for example, `/mycars/__id`.

@@ -87,3 +92,3 @@ The returned map will be in the following format:

{
get: {
GET: {
visible: true,

@@ -93,3 +98,3 @@ enabled: false,

},
post: {
POST: {
visible: true,

@@ -99,6 +104,6 @@ enabled: false,

},
put: {
PUT: {
//...
},
delete: {
DELETE: {
//...

@@ -113,4 +118,4 @@ }

const resource = aserto.resourceMap(path));
const isVisible = resource.get.visible;
const isEnabled = resource.get.enabled;
const isVisible = resource.GET.visible;
const isEnabled = resource.GET.enabled;
```

@@ -122,3 +127,3 @@

const resource = aserto.resourceMap(path));
for (const verb of ['get', 'post', 'put', 'delete']) {
for (const verb of ['GET', 'POST', 'PUT', 'DELETE']) {
for (const access of ['visible', 'enabled', 'allowed']) {

@@ -125,0 +130,0 @@ console.log(`${verb} ${path} ${access} is ${resource[verb][access]}`);

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