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

@chapeaux/cpx-user

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chapeaux/cpx-user - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

2

cpx-user.d.ts

@@ -21,2 +21,3 @@ export declare class CPXUser extends HTMLElement {

set user(val: any);
_worker: any;
constructor();

@@ -28,3 +29,4 @@ connectedCallback(): void;

camelCase(str: String, to?: boolean): string;
onMessage(e: any): void;
dispatchEDDL(): Promise<void>;
}

@@ -19,2 +19,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

this._ready = false;
console.log(new URL(import.meta.url).pathname.replace('cpx-user.js', 'user.js'));
this._worker = new Worker(new URL(import.meta.url).pathname.replace('cpx-user.js', 'user.js'));
this.onMessage = this.onMessage.bind(this);
}

@@ -97,2 +100,11 @@ get userId() {

if (this.eddl) {
this._worker.postMessage({
action: 'getCookies',
values: new Map([
['rh_common_id', 'custKey'],
['rh_user_id', 'userID'],
['rh_sso_session', 'loggedIn']
]),
payload: document.cookie
});
this.dispatchEDDL();

@@ -110,2 +122,3 @@ }

});
this._worker.onmessage = this.onMessage;
}

@@ -139,2 +152,14 @@ static get observedAttributes() {

}
onMessage(e) {
const data = e.data;
if (data.action) {
switch (data.action) {
case 'getCookies':
if (data.results) {
Object.assign(this.user, data.results);
}
break;
}
}
}
dispatchEDDL() {

@@ -145,5 +170,7 @@ return __awaiter(this, void 0, void 0, function* () {

detail: {
custKey: this.user['custKey'],
accountID: this.user['account_number'] || '',
userID: this.user['preferred_username'],
userID: this.user['userID'],
lastLoginDate: this.user['auth_time'],
loggedIn: this.user['loggedIn'] ? "true" : "false",
hashedEmail: hashedEmail

@@ -150,0 +177,0 @@ },

2

package.json
{
"name": "@chapeaux/cpx-user",
"version": "0.6.0",
"version": "0.7.0",
"description": "Chapeaux User Component",

@@ -5,0 +5,0 @@ "type": "module",

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

export declare class User {
declare function getCookies(cookies: any, values: Map<string, string>): {};
declare class User {
constructor(obj?: any);

@@ -3,0 +4,0 @@ givenname: string;

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

export class User {
"use strict";
function getCookies(cookies, values) {
let obj = {};
let cookieMap = new Map();
cookies.split(';').map(v => {
const rec = v.trim().split('=');
cookieMap.set(rec[0], rec[1]);
});
for (const [key, value] of values) {
obj[value] = cookieMap.get(key);
}
return obj;
}
onmessage = function (e) {
if (e.data && e.data.action) {
switch (e.data.action) {
case 'getCookies':
postMessage({ action: e.data.action, results: getCookies(e.data.payload, e.data.values) });
break;
default:
postMessage({});
break;
}
}
};
class User {
constructor(obj) {

@@ -3,0 +28,0 @@ this.givenname = "";

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