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

@manifoldco/shadowcat

Package Overview
Dependencies
Maintainers
21
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@manifoldco/shadowcat - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6-rc.0

dist/cjs/core-136c5e11.js

6

dist/cjs/loader.cjs.js

@@ -5,7 +5,7 @@ 'use strict';

const __chunk_1 = require('./chunk-93d86c38.js');
const core = require('./core-136c5e11.js');
const defineCustomElements = (win, options) => {
return __chunk_1.patchEsm().then(() => {
__chunk_1.bootstrapLazy([["manifold-oauth.cjs",[[0,"manifold-oauth",{"oauthUrl":[1,"oauth-url"]}]]]], options);
return core.patchEsm().then(() => {
core.bootstrapLazy([["manifold-oauth.cjs",[[0,"manifold-oauth",{"oauthUrl":[1,"oauth-url"]}]]]], options);
});

@@ -12,0 +12,0 @@ };

@@ -5,8 +5,8 @@ 'use strict';

const __chunk_1 = require('./chunk-93d86c38.js');
const core = require('./core-136c5e11.js');
class ManifoldOauth {
const ManifoldOauth = class {
constructor(hostRef) {
__chunk_1.registerInstance(this, hostRef);
this.oauthUrl = "https://login.manifold.co/signin/oauth/web";
core.registerInstance(this, hostRef);
this.oauthUrl = 'https://login.manifold.co/signin/oauth/web';
this.tokenListener = (ev) => {

@@ -17,18 +17,32 @@ const pumaToken = ev.data;

expiry: pumaToken.expiry,
error: pumaToken.error
error: pumaToken.error,
duration: new Date().getTime() - this.loadTime.getTime(),
});
};
this.receiveManifoldToken = __chunk_1.createEvent(this, "receiveManifoldToken", 7);
this.receiveManifoldToken = core.createEvent(this, "receiveManifoldToken", 7);
}
componentWillLoad() {
window.addEventListener("message", this.tokenListener);
this.loadTime = new Date();
window.addEventListener('message', this.tokenListener);
}
componentDidUnload() {
window.removeEventListener("message", this.tokenListener);
window.removeEventListener('message', this.tokenListener);
}
render() {
return __chunk_1.h("iframe", { style: { display: "none" }, src: this.oauthUrl });
return (core.h("iframe", { src: this.oauthUrl, allowtransparency: "true", "aria-hidden": "true", frameborder: "0", id: "manifold-oauth-window", name: "manifold-oauth-window", scrolling: "no", tabindex: "-1", style: {
border: 'none',
display: 'block',
height: '1px',
left: '0',
margin: '0px',
padding: '0px',
pointerEvents: 'none',
position: 'fixed',
userSelect: 'none',
visibility: 'hidden',
width: '75vw',
} }));
}
}
};
exports.manifold_oauth = ManifoldOauth;

@@ -7,4 +7,4 @@ {

"name": "@stencil/core",
"version": "1.1.6",
"typescriptVersion": "3.5.2"
"version": "1.3.0",
"typescriptVersion": "3.5.3"
},

@@ -11,0 +11,0 @@ "collections": [],

import { h } from "@stencil/core";
export class ManifoldOauth {
constructor() {
this.oauthUrl = "https://login.manifold.co/signin/oauth/web";
this.oauthUrl = 'https://login.manifold.co/signin/oauth/web';
this.tokenListener = (ev) => {

@@ -10,3 +10,4 @@ const pumaToken = ev.data;

expiry: pumaToken.expiry,
error: pumaToken.error
error: pumaToken.error,
duration: new Date().getTime() - this.loadTime.getTime(),
});

@@ -16,9 +17,22 @@ };

componentWillLoad() {
window.addEventListener("message", this.tokenListener);
this.loadTime = new Date();
window.addEventListener('message', this.tokenListener);
}
componentDidUnload() {
window.removeEventListener("message", this.tokenListener);
window.removeEventListener('message', this.tokenListener);
}
render() {
return h("iframe", { style: { display: "none" }, src: this.oauthUrl });
return (h("iframe", { src: this.oauthUrl, allowtransparency: "true", "aria-hidden": "true", frameborder: "0", id: "manifold-oauth-window", name: "manifold-oauth-window", scrolling: "no", tabindex: "-1", style: {
border: 'none',
display: 'block',
height: '1px',
left: '0',
margin: '0px',
padding: '0px',
pointerEvents: 'none',
position: 'fixed',
userSelect: 'none',
visibility: 'hidden',
width: '75vw',
} }));
}

@@ -43,3 +57,3 @@ static get is() { return "manifold-oauth"; }

"reflect": false,
"defaultValue": "\"https://login.manifold.co/signin/oauth/web\""
"defaultValue": "'https://login.manifold.co/signin/oauth/web'"
}

@@ -46,0 +60,0 @@ }; }

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

import { r as registerInstance, c as createEvent, h } from './chunk-1164485d.js';
import { r as registerInstance, c as createEvent, h } from './core-205678be.js';
class ManifoldOauth {
const ManifoldOauth = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.oauthUrl = "https://login.manifold.co/signin/oauth/web";
this.oauthUrl = 'https://login.manifold.co/signin/oauth/web';
this.tokenListener = (ev) => {

@@ -12,3 +12,4 @@ const pumaToken = ev.data;

expiry: pumaToken.expiry,
error: pumaToken.error
error: pumaToken.error,
duration: new Date().getTime() - this.loadTime.getTime(),
});

@@ -19,12 +20,25 @@ };

componentWillLoad() {
window.addEventListener("message", this.tokenListener);
this.loadTime = new Date();
window.addEventListener('message', this.tokenListener);
}
componentDidUnload() {
window.removeEventListener("message", this.tokenListener);
window.removeEventListener('message', this.tokenListener);
}
render() {
return h("iframe", { style: { display: "none" }, src: this.oauthUrl });
return (h("iframe", { src: this.oauthUrl, allowtransparency: "true", "aria-hidden": "true", frameborder: "0", id: "manifold-oauth-window", name: "manifold-oauth-window", scrolling: "no", tabindex: "-1", style: {
border: 'none',
display: 'block',
height: '1px',
left: '0',
margin: '0px',
padding: '0px',
pointerEvents: 'none',
position: 'fixed',
userSelect: 'none',
visibility: 'hidden',
width: '75vw',
} }));
}
}
};
export { ManifoldOauth as manifold_oauth };

@@ -379,3 +379,9 @@ /*

// computes the css scopes that might affect this particular element
var scopes = globalScopes.concat(getScopesForElement(hostScopeMap, hostEl));
// avoiding using spread arrays to avoid ts helper fns when in es5
var scopes = [];
var scopesForElement = getScopesForElement(hostScopeMap, hostEl);
// globalScopes are always took into account
globalScopes.forEach(function (s) { return scopes.push(s); });
// the parent scopes are computed by walking parent dom until <html> is reached
scopesForElement.forEach(function (s) { return scopes.push(s); });
// each scope might have an array of associated selectors

@@ -382,0 +388,0 @@ // let's flatten the complete array of selectors from all the scopes

@@ -93,2 +93,3 @@ (function(){

(function(a){"function"!==typeof a.matches&&(a.matches=a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||function(a){a=(this.document||this.ownerDocument).querySelectorAll(a);for(var b=0;a[b]&&a[b]!==this;)++b;return!!a[b]});"function"!==typeof a.closest&&(a.closest=function(a){for(var b=this;b&&1===b.nodeType;){if(b.matches(a))return b;b=b.parentNode}return null})})(window.Element.prototype);
/*!

@@ -98,2 +99,3 @@ Element.getRootNode()

(function(c){function d(a){a=b(a);return 11===a.nodeType?d(a.host):a}function b(a){return a.parentNode?b(a.parentNode):a}"function"!==typeof c.getRootNode&&(c.getRootNode=function(a){return a&&a.composed?d(this):b(this)})})(Element.prototype);
/*!

@@ -108,2 +110,1 @@ Element.remove()

!function(e){'classList'in e||Object.defineProperty(e,"classList",{get:function(){var e=this,t=(e.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){t.length>0?e.setAttribute("class",t.join(" ")):e.removeAttribute("class")}return""===t[0]&&t.splice(0,1),t.toggle=function(e,i){void 0!==i?i?t.add(e):t.remove(e):-1!==t.indexOf(e)?t.splice(t.indexOf(e),1):t.push(e),n()},t.add=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1===t.indexOf(e[i])&&t.push(e[i]);n()},t.remove=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1!==t.indexOf(e[i])&&t.splice(t.indexOf(e[i]),1);n()},t.item=function(e){return t[e]},t.contains=function(e){return-1!==t.indexOf(e)},t.replace=function(e,i){-1!==t.indexOf(e)&&t.splice(t.indexOf(e),1,i),n()},t.value=e.getAttribute("class")||"",t}})}(Element.prototype);
export function applyPolyfills() {
var win = window;
/*!
es6-promise - a tiny implementation of Promises/A+.
Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
Licensed under MIT license
See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
v4.2.4+314e4831
*/
(win.ES6Promise=function(){function t(){var t=setTimeout;return function(){return t(r,1)}}function r(){for(var t=0;t<y;t+=2)(0,C[t])(C[t+1]),C[t]=void 0,C[t+1]=void 0;y=0}function e(t,r){var e=this,n=new this.constructor(o);void 0===n[O]&&_(n);var i=e._state;if(i){var s=arguments[i-1];g(function(){return v(i,n,s,e._result)})}else l(e,n,t,r);return n}function n(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var r=new this(o);return u(r,t),r}function o(){}function i(t){try{return t.then}catch(t){return q.error=t,q}}function s(t,r,o){r.constructor===t.constructor&&o===e&&r.constructor.resolve===n?function(t,r){r._state===x?a(t,r._result):r._state===F?f(t,r._result):l(r,void 0,function(r){return u(t,r)},function(r){return f(t,r)})}(t,r):o===q?(f(t,q.error),q.error=null):void 0===o?a(t,r):"function"==typeof o?function(t,r,e){g(function(t){var n=!1,o=function(t,r,e,n){try{t.call(r,e,n)}catch(t){return t}}(e,r,function(e){n||(n=!0,r!==e?u(t,e):a(t,e))},function(r){n||(n=!0,f(t,r))},t._label);!n&&o&&(n=!0,f(t,o))},t)}(t,r,o):a(t,r)}function u(t,r){if(t===r)f(t,new TypeError("cannot resolve promise w/ itself"));else{var e=typeof r;null===r||"object"!==e&&"function"!==e?a(t,r):s(t,r,i(r))}}function c(t){t._onerror&&t._onerror(t._result),h(t)}function a(t,r){t._state===P&&(t._result=r,t._state=x,0!==t._subscribers.length&&g(h,t))}function f(t,r){t._state===P&&(t._state=F,t._result=r,g(c,t))}function l(t,r,e,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=r,o[i+x]=e,o[i+F]=n,0===i&&t._state&&g(h,t)}function h(t){var r=t._subscribers,e=t._state;if(0!==r.length){for(var n,o,i=t._result,s=0;s<r.length;s+=3)n=r[s],o=r[s+e],n?v(e,n,o,i):o(i);t._subscribers.length=0}}function v(t,r,e,n){var o="function"==typeof e,i=void 0,s=void 0,c=void 0,l=void 0;if(o){try{i=e(n)}catch(t){q.error=t,i=q}if(i===q?(l=!0,s=i.error,i.error=null):c=!0,r===i)return void f(r,new TypeError("Cannot return same promise"))}else i=n,c=!0;r._state===P&&(o&&c?u(r,i):l?f(r,s):t===x?a(r,i):t===F&&f(r,i))}function _(t){t[O]=U++,t._state=void 0,t._result=void 0,t._subscribers=[]}var p,d=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},y=0,w=void 0,m=void 0,g=function(t,e){C[y]=t,C[y+1]=e,2===(y+=2)&&(m?m(r):T())},b=(p="undefined"!=typeof window?window:void 0)||{},A=b.MutationObserver||b.WebKitMutationObserver;b="undefined"==typeof self;var E,S,M,j="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,C=Array(1e3),T=void 0;T=A?(E=0,S=new A(r),M=document.createTextNode(""),S.observe(M,{characterData:!0}),function(){M.data=E=++E%2}):j?function(){var t=new MessageChannel;return t.port1.onmessage=r,function(){return t.port2.postMessage(0)}}():void 0===p&&"function"==typeof require?function(){try{var e=Function("return this")().require("vertx");return void 0!==(w=e.runOnLoop||e.runOnContext)?function(){w(r)}:t()}catch(r){return t()}}():t();var O=Math.random().toString(36).substring(2),P=void 0,x=1,F=2,q={error:null},U=0,D=function(){function t(t,r){this._instanceConstructor=t,this.promise=new t(o),this.promise[O]||_(this.promise),d(r)?(this._remaining=this.length=r.length,this._result=Array(this.length),0===this.length?a(this.promise,this._result):(this.length=this.length||0,this._enumerate(r),0===this._remaining&&a(this.promise,this._result))):f(this.promise,Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var r=0;this._state===P&&r<t.length;r++)this._eachEntry(t[r],r)},t.prototype._eachEntry=function(t,r){var u=this._instanceConstructor,c=u.resolve;c===n?(c=i(t))===e&&t._state!==P?this._settledAt(t._state,r,t._result):"function"!=typeof c?(this._remaining--,this._result[r]=t):u===K?(s(u=new u(o),t,c),this._willSettleAt(u,r)):this._willSettleAt(new u(function(r){return r(t)}),r):this._willSettleAt(c(t),r)},t.prototype._settledAt=function(t,r,e){var n=this.promise;n._state===P&&(this._remaining--,t===F?f(n,e):this._result[r]=e),0===this._remaining&&a(n,this._result)},t.prototype._willSettleAt=function(t,r){var e=this;l(t,void 0,function(t){return e._settledAt(x,r,t)},function(t){return e._settledAt(F,r,t)})},t}(),K=function(){function t(r){if(this[O]=U++,this._result=this._state=void 0,this._subscribers=[],o!==r){if("function"!=typeof r)throw new TypeError("Must pass a resolver fn as 1st arg");if(!(this instanceof t))throw new TypeError("Failed to construct 'Promise': Use the 'new' operator.");!function(t,r){try{r(function(r){u(t,r)},function(r){f(t,r)})}catch(r){f(t,r)}}(this,r)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var r=this.constructor;return this.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})})},t}();return K.prototype.then=e,K.all=function(t){return new D(this,t).promise},K.race=function(t){var r=this;return d(t)?new r(function(e,n){for(var o=t.length,i=0;i<o;i++)r.resolve(t[i]).then(e,n)}):new r(function(t,r){return r(new TypeError("Must pass array to race"))})},K.resolve=n,K.reject=function(t){var r=new this(o);return f(r,t),r},K._setScheduler=function(t){m=t},K._setAsap=function(t){g=t},K._asap=g,K.polyfill=function(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw Error("polyfill failed")}var r=t.Promise;if(r){var e=null;try{e=Object.prototype.toString.call(r.resolve())}catch(t){}if("[object Promise]"===e&&!r.cast)return}t.Promise=K},K.Promise=K,K.polyfill(),K}());

@@ -32,2 +24,3 @@ var promises = [];

!String.prototype.startsWith || !String.prototype.endsWith ||
(win.NodeList && !win.NodeList.prototype.forEach) ||
!win.fetch ||

@@ -34,0 +27,0 @@ !checkIfURLIsSupported() ||

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

/*
* SystemJS 3.1.3
*/
!function(){var e,n="undefined"!=typeof self,t=n?self:global;if("undefined"!=typeof location){var r=(e=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==r&&(e=e.slice(0,r+1))}var i=/\\/g,o="undefined"!=typeof Symbol,u=o&&Symbol.toStringTag,f=o?Symbol():"@";function c(){this[f]={}}var l,s=c.prototype;s.import=function(e,n){var t=this;return Promise.resolve(t.resolve(e,n)).then(function(e){var n=function e(n,t,r){var i=n[f][t];if(i)return i;var o=[],c=Object.create(null);u&&Object.defineProperty(c,u,{value:"Module"});var l=Promise.resolve().then(function(){return n.instantiate(t,r)}).then(function(e){if(!e)throw new Error("Module "+t+" did not instantiate");var r=e[1](function(e,n){i.h=!0;var t=!1;if("object"!=typeof e)e in c&&c[e]===n||(c[e]=n,t=!0);else for(var r in e){var u=e[r];r in c&&c[r]===u||(c[r]=u,t=!0)}if(t)for(var f=0;f<o.length;f++)o[f](c);return n},2===e[1].length?{import:function(e){return n.import(e,t)},meta:n.createContext(t)}:void 0);return i.e=r.execute||function(){},[e[0],r.setters||[]]}),s=l.then(function(r){return Promise.all(r[0].map(function(i,o){var u=r[1][o];return Promise.resolve(n.resolve(i,t)).then(function(r){var i=e(n,r,t);return Promise.resolve(i.I).then(function(){return u&&(i.i.push(u),!i.h&&i.I||u(i.n)),i})})})).then(function(e){i.d=e})});return s.catch(function(e){i.e=null,i.er=e}),i=n[f][t]={id:t,i:o,n:c,I:l,L:s,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(t,e);return n.C||function(e,n){return n.C=function e(n,t,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then(function(){return Promise.all(t.d.map(function(t){return e(n,t,r)}))})}(e,n,{}).then(function(){return function e(n,t,r){if(!r[t.id]){if(r[t.id]=!0,!t.e){if(t.er)throw t.er;return t.E?t.E:void 0}var i;return t.d.forEach(function(t){var o=e(n,t,r);o&&(i=i||[]).push(o)}),i?Promise.all(i).then(o):o()}function o(){try{var e=t.e.call(d);if(e)return e=e.then(function(){t.C=t.n,t.E=null}),t.E=t.E||e;t.C=t.n}catch(e){throw t.er=e,e}finally{t.L=t.I=void 0,t.e=null}}}(e,n,{})}).then(function(){return n.n})}(t,n)})},s.createContext=function(e){return{url:e}},s.register=function(e,n){l=[e,n]},s.getRegister=function(){var e=l;return l=void 0,e};var a,d=Object.freeze(Object.create(null));t.System=new c,"undefined"!=typeof window&&window.addEventListener("error",function(e){a=e.error});var v=s.register;s.register=function(e,n){a=void 0,v.call(this,e,n)},s.instantiate=function(e,n){var t=this;return new Promise(function(r,i){var o=document.createElement("script");o.charset="utf-8",o.async=!0,o.crossOrigin="anonymous",o.addEventListener("error",function(){i(new Error("Error loading "+e+(n?" from "+n:"")))}),o.addEventListener("load",function(){if(document.head.removeChild(o),a)return i(a),a=void 0;r(t.getRegister())}),o.src=e,document.head.appendChild(o)})},n&&"function"==typeof importScripts&&(s.instantiate=function(e){var n=this;return new Promise(function(t,r){try{importScripts(e)}catch(e){r(e)}t(n.getRegister())})}),s.resolve=function(n,t){var r=function(e,n){if(-1!==e.indexOf("\\")&&(e=e.replace(i,"/")),"/"===e[0]&&"/"===e[1])return n.slice(0,n.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){var t,r=n.slice(0,n.indexOf(":")+1);if(t="/"===n[r.length+1]?"file:"!==r?(t=n.slice(r.length+2)).slice(t.indexOf("/")+1):n.slice(8):n.slice(r.length+("/"===n[r.length])),"/"===e[0])return n.slice(0,n.length-t.length-1)+e;for(var o=t.slice(0,t.lastIndexOf("/")+1)+e,u=[],f=-1,c=0;c<o.length;c++)-1!==f?"/"===o[c]&&(u.push(o.slice(f,c+1)),f=-1):"."===o[c]?"."!==o[c+1]||"/"!==o[c+2]&&c+2!==o.length?"/"===o[c+1]||c+1===o.length?c+=1:f=c:(u.pop(),c+=2):f=c;return-1!==f&&u.push(o.slice(f)),n.slice(0,n.length-t.length)+u.join("")}}(n,t||e);if(!r){if(-1!==n.indexOf(":"))return Promise.resolve(n);throw new Error('Cannot resolve "'+n+(t?'" from '+t:'"'))}return Promise.resolve(r)}}();
/**
* SystemJS 4.0.2
* MANUAL PATCH: remove script.crossOrigin = "anonymous"
*/
!function(){const e="undefined"!=typeof self,n=e?self:global;let t;if("undefined"!=typeof document){const e=document.querySelector("base[href]");e&&(t=e.href)}if(!t&&"undefined"!=typeof location){const e=(t=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==e&&(t=t.slice(0,e+1))}const r=/\\/g,o="undefined"!=typeof Symbol,i=o&&Symbol.toStringTag,c=o?Symbol():"@";function u(){this[c]={}}const s=u.prototype;let l;s.import=function(e,n){const t=this;return Promise.resolve(t.resolve(e,n)).then(function(e){const n=function e(n,t,r){let o=n[c][t];if(o)return o;const u=[],s=Object.create(null);i&&Object.defineProperty(s,i,{value:"Module"});let l=Promise.resolve().then(function(){return n.instantiate(t,r)}).then(function(e){if(!e)throw Error("Module "+t+" did not instantiate");const r=e[1](function(e,n){o.h=!0;let t=!1;if("object"!=typeof e)e in s&&s[e]===n||(s[e]=n,t=!0);else for(let n in e){let r=e[n];n in s&&s[n]===r||(s[n]=r,t=!0)}if(t)for(let e=0;e<u.length;e++)u[e](s);return n},2===e[1].length?{import:function(e){return n.import(e,t)},meta:n.createContext(t)}:void 0);return o.e=r.execute||function(){},[e[0],r.setters||[]]});const f=l.then(function(r){return Promise.all(r[0].map(function(o,i){const c=r[1][i];return Promise.resolve(n.resolve(o,t)).then(function(r){const o=e(n,r,t);return Promise.resolve(o.I).then(function(){return c&&(o.i.push(c),!o.h&&o.I||c(o.n)),o})})})).then(function(e){o.d=e})});return f.catch(function(e){o.e=null,o.er=e}),o=n[c][t]={id:t,i:u,n:s,I:l,L:f,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(t,e);return n.C||function(e,n){return n.C=function e(n,t,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then(function(){return Promise.all(t.d.map(function(t){return e(n,t,r)}))})}(e,n,{}).then(function(){return function e(n,t,r){if(r[t.id])return;if(r[t.id]=!0,!t.e){if(t.er)throw t.er;return t.E?t.E:void 0}let o;return t.d.forEach(function(t){{const i=e(n,t,r);i&&(o=o||[]).push(i)}}),o?Promise.all(o).then(i):i();function i(){try{let e=t.e.call(f);if(e)return e=e.then(function(){t.C=t.n,t.E=null}),t.E=t.E||e;t.C=t.n}catch(e){throw t.er=e,e}finally{t.L=t.I=void 0,t.e=null}}}(e,n,{})}).then(function(){return n.n})}(t,n)})},s.createContext=function(e){return{url:e}},s.register=function(e,n){l=[e,n]},s.getRegister=function(){const e=l;return l=void 0,e};const f=Object.freeze(Object.create(null));n.System=new u;const d=s.register;s.register=function(e,n){d.call(this,e,n)},s.instantiate=function(e,n){const t=this;return".json"===e.substr(-5)?fetch(e).then(function(e){return e.text()}).then(function(e){return[[],function(n){return{execute:function(){n("default",JSON.parse(e))}}}]}):new Promise(function(r,o){let i;function c(n){n.filename===e&&(i=n.error)}window.addEventListener("error",c);const u=document.createElement("script");u.charset="utf-8",u.async=!0,u.addEventListener("error",function(){window.removeEventListener("error",c),o(Error("Error loading "+e+(n?" from "+n:"")))}),u.addEventListener("load",function(){window.removeEventListener("error",c),document.head.removeChild(u),i?o(i):r(t.getRegister())}),u.src=e,document.head.appendChild(u)})},e&&"function"==typeof importScripts&&(s.instantiate=function(e){const n=this;return new Promise(function(t,r){try{importScripts(e)}catch(e){r(e)}t(n.getRegister())})}),s.resolve=function(e,n){const o=function(e,n){if(-1!==e.indexOf("\\")&&(e=e.replace(r,"/")),"/"===e[0]&&"/"===e[1])return n.slice(0,n.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){const t=n.slice(0,n.indexOf(":")+1);let r;if(r="/"===n[t.length+1]?"file:"!==t?(r=n.slice(t.length+2)).slice(r.indexOf("/")+1):n.slice(8):n.slice(t.length+("/"===n[t.length])),"/"===e[0])return n.slice(0,n.length-r.length-1)+e;const o=r.slice(0,r.lastIndexOf("/")+1)+e,i=[];let c=-1;for(let e=0;e<o.length;e++)-1!==c?"/"===o[e]&&(i.push(o.slice(c,e+1)),c=-1):"."===o[e]?"."!==o[e+1]||"/"!==o[e+2]&&e+2!==o.length?"/"===o[e+1]||e+1===o.length?e+=1:c=e:(i.pop(),e+=2):c=e;return-1!==c&&i.push(o.slice(c)),n.slice(0,n.length-r.length)+i.join("")}}(e,n||t);if(!o){if(-1!==e.indexOf(":"))return Promise.resolve(e);throw Error('Cannot resolve "'+e+(n?'" from '+n:'"'))}return Promise.resolve(o)}}();
{
"name": "shadowcat-loader",
"name": "manifold-loader",
"typings": "./index.d.ts",

@@ -9,3 +9,4 @@ "module": "./index.mjs",

"es2015": "./index.es2017.mjs",
"es2017": "./index.es2017.mjs"
"es2017": "./index.es2017.mjs",
"unpkg": "./cdn.js"
}

@@ -1,6 +0,7 @@

import { EventEmitter } from "../../stencil.core";
import { AuthToken } from "../../interface";
import { EventEmitter } from '../../stencil.core';
import { AuthToken } from '../../interface';
export declare class ManifoldOauth {
oauthUrl?: string;
receiveManifoldToken: EventEmitter<AuthToken>;
private loadTime?;
tokenListener: (ev: MessageEvent) => void;

@@ -7,0 +8,0 @@ componentWillLoad(): void;

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

export * from "./components";
export * from './components';

@@ -12,2 +12,3 @@ export interface AuthError {

error?: AuthError;
duration?: number;
}

@@ -14,0 +15,0 @@

{
"name": "@manifoldco/shadowcat",
"description": "Invisible web component auth implementation of Manifold's PUMA",
"repository": {
"type": "git",
"url": "git+https://github.com/manifoldco/shadowcat.git"
},
"homepage": "https://github.com/manifoldco/shadowcat",
"bugs": { "url": "https://github.com/manifoldco/shadowcat/issues" },
"engines": { "node": ">=10.16.0" },
"author": "manifoldco",
"license": "BSD",
"main": "dist/index.js",

@@ -12,17 +21,18 @@ "module": "dist/index.mjs",

"unpkg": "dist/shadowcat/shadowcat.js",
"files": [
"dist/"
"bundlesize": [
{
"path": "./dist/esm/loader.mjs",
"maxSize": "1 kB",
"compression": "none"
},
{
"path": "./dist/esm/manifold*.js",
"maxSize": "2 kB",
"compression": "none"
}
],
"scripts": {
"build": "stencil build --docs",
"publish": "node scripts/publish",
"start": "stencil build --dev --watch --serve",
"test": "stencil test --spec --e2e",
"test:coverage": "npm run test --coverage",
"test.watch": "stencil test --spec --e2e --watchAll"
},
"devDependencies": {
"@stencil/core": "^1.1.9",
"@types/jest": "24.0.15",
"@types/puppeteer": "1.12.4",
"@stencil/core": "^1.3.0",
"@types/jest": "24.0.17",
"@types/puppeteer": "1.19.1",
"fs-extra": "^8.1.0",

@@ -32,6 +42,5 @@ "jest": "24.8.0",

"prettier": "^1.18.2",
"puppeteer": "1.17.0"
"puppeteer": "1.19.0"
},
"license": "MIT",
"version": "0.1.5"
"version": "0.1.6-rc.0"
}
# shadowcat
Invisible web component auth implementation of Manifold&#39;s PUMA &lt;https://github.com/manifoldco/puma&gt;
Simple JS OAuth solutions for [Manifold UI][manifold-ui]
## Usage
1. `npm i @manifoldco/shadowcat`
2. Import and register the `manifold-oauth` web component:
### React
```js
import { defineCustomElements } from '@manifoldco/shadowcat/dist/loader';
In a terminal, install `@manifoldco/shadowcat` for your app:
defineCustomElements(window);
```bash
npm i @manifoldco/shadowcat
```
3. Add the following code anywhere on your website/app to get an auth token:
Then register the web component (we recommend as high up the DOM tree as possible, so it’ll load sooner).
```jsx
import React, { useEffect, useRef } from "react";
import("@manifoldco/shadowcat/dist/loader").then(({ defineCustomElements }) =>
defineCustomElements(window)
);
const App = () => {
const authRef = useRef(null);
useEffect(() => {
// Fires whenever a token is received
const tokenReceived = detail => {
console.log(detail);
// {
// duration: 1450,
// error: null,
// expiry: 1566565841,
// token: "Hi I'm a super duper secret token!"
// }
};
if (authRef.current) {
authRef.addEventListener("receiveManifoldToken", tokenReceived);
}
}, []);
return (
<>
<Routes />
<manifold-oauth ref={authRef} /> {/* this can be placed anywhere, really, but the sooner it loads the better */}
</>
);
};
```
### HTML / JS
```html
<manifold-oauth oauth-url="[your-oauth-url]"></manifold-oauth>
<body>
<manifold-auth></manifold-auth>
<script src="https://unpkg.com/@manifoldco/shadowcat/dist/manifold.js"></script>
<script>
document
.querySelector("manifold-oauth")
.addEventListener("receiveManifoldToken", e => {
console.log(e.detail);
// {
// duration: 1450,
// error: null,
// expiry: 1566565841,
// token: "Hi I'm a super duper secret token!"
// }
});
</script>
</body>
```
4. Listen for the event `tokenReceived`:
### CDN
```js
document.addEventListener("tokenReceived", e => {
console.log(e.detail); // received token
// do stuff...
});
In any setup, you can use a CDN for Shadowcat
```
https://js.cdn.manifold.co/@manifoldco/shadowcat/ # latest (beware of breaking changes!)
https://js.cdn.manifold.co/@manifoldco/shadowcat@0.2.0/ # specific version
```
## Dev Setup
## Options
1. `npm install` to install dependencies.
1. `npm start` to start the development server.
1. Go to `localhost:3333`. The development server will display a blank page.
1. Open the console. There will be a message/token logged.
### OAuth URL
## Publish to npm
You can change the OAuth URL from Manifold’s default by specifying `oauth-url` on the custom element:
1. Add a git tag with the version number you want to publish.
- For example, version 1 would be `git tag v1.0.0`.
1. Publish the version to npm by running `npm run publish`.
- Ensure that you're logged into your npm account and have access to publish packages in the `@manifoldco` org when you do this.
```html
<manifold-oauth oauth-url="[your-oauth-url]"></manifold-oauth>
```
## Links

@@ -58,1 +106,3 @@

[![License](https://img.shields.io/badge/license-BSD-blue.svg)](./LICENSE.md)
[manifold-ui]: https://ui.sandbox.manifold.co

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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