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

idea-toolbox

Package Overview
Dependencies
Maintainers
2
Versions
377
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idea-toolbox - npm Package Compare versions

Comparing version 6.5.0 to 6.5.1

20

dist/src/cognitoUser.model.d.ts

@@ -1,6 +0,5 @@

import { Resource } from './resource.model';
/**
* A user stored in a Cognito User Pool.
*/
export declare class CognitoUser extends Resource {
export declare class CognitoUser {
/**

@@ -11,2 +10,6 @@ * The id of the user.

/**
* The email address of the user.
*/
email: string;
/**
* The fullname of the user.

@@ -16,6 +19,2 @@ */

/**
* The email address of the user.
*/
email: string;
/**
* The list of groups containing the user.

@@ -25,7 +24,8 @@ */

/**
* Load the attributes from an already existing resource.
* Note: the method also reads from the user's token (claims) format.
* The user's custom attributes.
*/
load(x: any): void;
validate(): string[];
custom: {
[attribute: string]: string | number;
};
constructor(x?: any);
/**

@@ -32,0 +32,0 @@ * Whether the user is part of the administrators group.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CognitoUser = void 0;
const resource_model_1 = require("./resource.model");
/**
* A user stored in a Cognito User Pool.
*/
class CognitoUser extends resource_model_1.Resource {
/**
* Load the attributes from an already existing resource.
* Note: the method also reads from the user's token (claims) format.
*/
load(x) {
super.load(x);
this.userId = this.clean(x.userId || x.sub, String);
this.name = this.clean(x.name, String);
this.email = this.clean(x.email, String);
this.groups = this.cleanArray(x.groups || x['cognito:groups']?.split(','), String);
class CognitoUser {
constructor(x = {}) {
this.userId = x.userId || x.sub;
this.email = x.email;
this.name = x.name;
this.groups = x.groups || x['cognito:groups']?.split(',');
if (x.custom)
this.custom = x.custom;
else {
this.custom = {};
Object.keys(x)
.filter(a => a.startsWith('custom:'))
.forEach(a => (this.custom[a.slice('custom:'.length + 1)] = x[a]));
}
}
validate() {
const e = super.validate();
if (this.iE(this.name))
e.push('name');
if (this.iE(this.email))
e.push('email');
return e;
}
/**

@@ -29,0 +23,0 @@ * Whether the user is part of the administrators group.

{
"name": "idea-toolbox",
"version": "6.5.0",
"version": "6.5.1",
"description": "IDEA's utility functions",

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

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