@orbis-systems/orbis-api-client
Advanced tools
Comparing version 1.0.13 to 1.0.14
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),_SessionStore2=require("./SessionStore"),_SessionStore3=_interopRequireDefault(_SessionStore2);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var LocalStorage=function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,null,[{key:"client",value:function(){return"undefined"==typeof localStorage||null===localStorage?new(require("node-localstorage").LocalStorage)("./session"):localStorage}},{key:"get",value:function(a){if(!b.has(a))return null;var c=b.client().getItem(a);return JSON.parse(c).value}},{key:"set",value:function(a,c,d){var e=+new Date;return b.client().setItem(a,JSON.stringify({value:c,expiration:e+1e3*(60*d)}))}},{key:"has",value:function(a){var c=b.client().getItem(a);if(null===c||void 0===c)return!1;if(c=JSON.parse(c),!c.hasOwnProperty("expiration")||!c.hasOwnProperty("value"))return!1;var d=+new Date;return c.expiration>d}}]),b}(_SessionStore3.default);exports.default=LocalStorage; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),_SessionStore2=require("./SessionStore"),_SessionStore3=_interopRequireDefault(_SessionStore2);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var LocalStorage=function(a){function b(){return _classCallCheck(this,b),_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return _inherits(b,a),_createClass(b,null,[{key:"client",value:function(){try{if("undefined"==typeof localStorage||null===localStorage)return new(require("node-localstorage").LocalStorage)("./session")}catch(a){return localStorage}return localStorage}},{key:"get",value:function(a){if(!b.has(a))return null;var c=b.client().getItem(a);return JSON.parse(c).value}},{key:"set",value:function(a,c,d){var e=+new Date;return b.client().setItem(a,JSON.stringify({value:c,expiration:e+1e3*(60*d)}))}},{key:"has",value:function(a){var c=b.client().getItem(a);if(null===c||void 0===c)return!1;if(c=JSON.parse(c),!c.hasOwnProperty("expiration")||!c.hasOwnProperty("value"))return!1;var d=+new Date;return c.expiration>d}}]),b}(_SessionStore3.default);exports.default=LocalStorage; |
{ | ||
"name": "@orbis-systems/orbis-api-client", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/lib/index.js", |
@@ -6,3 +6,3 @@ ## This is in early development and is not ready for implementation. | ||
``` | ||
npm install orbis-api-client --save | ||
npm i -s @orbis-systems/orbis-api-client | ||
``` | ||
@@ -17,3 +17,3 @@ | ||
const APIClient = require("orbis-api-client"); | ||
const APIClient = require("@orbis-systems/orbis-api-client"); | ||
``` | ||
@@ -27,3 +27,3 @@ | ||
import APIClient from 'orbis-api-client'; | ||
import APIClient from '@orbis-systems/orbis-api-client'; | ||
``` | ||
@@ -85,2 +85,2 @@ | ||
- `set(key, value, expiration_in_minutes)` | ||
- `has(key)` (Returns boolean. Should also return false if it has expired) | ||
- `has(key)` (Returns boolean. Should also return false if it has expired) |
Sorry, the diff of this file is too big to display
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
586690
83