@adastradev/user-management-sdk
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -1,1 +0,1 @@ | ||
{"processes":{"065d7eda-9cab-4b8c-8b50-848074140563":{"parent":null,"children":[]},"607c443f-97df-4d09-9e7b-5f26bc1e9314":{"parent":"ad07cb49-df47-4b46-ad4e-99720741caaf","children":[]},"ad07cb49-df47-4b46-ad4e-99720741caaf":{"parent":null,"children":["607c443f-97df-4d09-9e7b-5f26bc1e9314"]}},"files":{"/opt/atlassian/pipelines/agent/build/source/AuthManager.ts":["065d7eda-9cab-4b8c-8b50-848074140563","607c443f-97df-4d09-9e7b-5f26bc1e9314"],"/opt/atlassian/pipelines/agent/build/source/CognitoUserPoolLocatorStatic.ts":["065d7eda-9cab-4b8c-8b50-848074140563","607c443f-97df-4d09-9e7b-5f26bc1e9314"],"/opt/atlassian/pipelines/agent/build/source/CognitoUserPoolLocatorUserManagement.ts":["065d7eda-9cab-4b8c-8b50-848074140563","607c443f-97df-4d09-9e7b-5f26bc1e9314"],"/opt/atlassian/pipelines/agent/build/source/index.ts":["065d7eda-9cab-4b8c-8b50-848074140563","607c443f-97df-4d09-9e7b-5f26bc1e9314"],"/opt/atlassian/pipelines/agent/build/source/UserManagementApi.ts":["065d7eda-9cab-4b8c-8b50-848074140563","607c443f-97df-4d09-9e7b-5f26bc1e9314"]},"externalIds":{}} | ||
{"processes":{"a5cb2639-4424-42eb-bb25-fdd58b8bef95":{"parent":null,"children":[]},"e78432bb-271a-4450-9392-4bad18c5f03b":{"parent":null,"children":[]}},"files":{"/opt/atlassian/pipelines/agent/build/source/index.ts":["a5cb2639-4424-42eb-bb25-fdd58b8bef95","e78432bb-271a-4450-9392-4bad18c5f03b"],"/opt/atlassian/pipelines/agent/build/source/AuthManager.ts":["a5cb2639-4424-42eb-bb25-fdd58b8bef95","e78432bb-271a-4450-9392-4bad18c5f03b"],"/opt/atlassian/pipelines/agent/build/source/CognitoUserPoolLocatorStatic.ts":["a5cb2639-4424-42eb-bb25-fdd58b8bef95","e78432bb-271a-4450-9392-4bad18c5f03b"],"/opt/atlassian/pipelines/agent/build/source/CognitoUserPoolLocatorUserManagement.ts":["a5cb2639-4424-42eb-bb25-fdd58b8bef95","e78432bb-271a-4450-9392-4bad18c5f03b"],"/opt/atlassian/pipelines/agent/build/source/UserManagementApi.ts":["a5cb2639-4424-42eb-bb25-fdd58b8bef95","e78432bb-271a-4450-9392-4bad18c5f03b"]},"externalIds":{}} |
@@ -10,3 +10,3 @@ import { ICognitoUserPoolLocator } from './ICognitoUserPoolLocator'; | ||
private poolData; | ||
private region; | ||
private readonly region; | ||
private cognitoUser; | ||
@@ -13,0 +13,0 @@ private cognitoUserSession; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -40,3 +41,4 @@ }); | ||
var amazon_cognito_identity_js_1 = require("amazon-cognito-identity-js"); | ||
var proxy = require("proxy-agent"); | ||
var proxy = require('proxy-agent'); | ||
// tslint:disable-next-line:no-duplicate-imports | ||
var global_1 = require("aws-sdk/global"); | ||
@@ -107,3 +109,3 @@ function configureAwsProxy(awsConfig) { | ||
newPasswordRequired: function (userAttributes, requiredAttributes) { | ||
if (newPassword !== undefined && newPassword.length > 0) { | ||
if (newPassword) { | ||
// User was signed up by an admin and must provide new | ||
@@ -110,0 +112,0 @@ // password and required attributes |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -48,3 +49,5 @@ }); | ||
CognitoUserPoolLocatorStatic.prototype.getPoolForUsername = function (userName) { | ||
return new Promise(function (resolve, reject) { | ||
return new Promise( | ||
// tslint:disable-next-line:ter-prefer-arrow-callback | ||
function (resolve, reject) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -51,0 +54,0 @@ var result; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -48,3 +49,5 @@ }); | ||
CognitoUserPoolLocatorUserManagement.prototype.getPoolForUsername = function (userName) { | ||
return new Promise(function (resolve, reject) { | ||
return new Promise( | ||
// tslint:disable-next-line:ter-prefer-arrow-callback | ||
function (resolve, reject) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -51,0 +54,0 @@ var api, response, result, error_1; |
@@ -6,6 +6,6 @@ import { ApiCredentials } from '@adastradev/serverless-discovery-sdk'; | ||
constructor(serviceEndpointUri: string, region: string, credentials: ApiCredentials, apigClient?: any); | ||
createUserPool(tenant_id: string): any; | ||
createUserPool(tenantId: string): any; | ||
deleteUserPool(id: string): any; | ||
getUserPools(): any; | ||
createUser(tenant_id: string, userName: string, password: string, firstName: string, lastName: string): any; | ||
createUser(tenantId: string, userName: string, password: string, firstName: string, lastName: string): any; | ||
registerTenant(tenantName: string, userName: string, firstName: string, lastName: string): any; | ||
@@ -12,0 +12,0 @@ deleteUser(userName: string): any; |
@@ -19,3 +19,3 @@ "use strict"; | ||
headers: { | ||
Authorization: 'Bearer ' + tokenCreds.idToken | ||
Authorization: "Bearer " + tokenCreds.idToken | ||
} | ||
@@ -29,5 +29,5 @@ }; | ||
this.apigClient = apigClientFactory.newClient({ | ||
region: region, | ||
accessKey: '', | ||
invokeUrl: serviceEndpointUri, | ||
region: region, | ||
secretKey: '' | ||
@@ -39,5 +39,5 @@ }); | ||
this.apigClient = apigClientFactory.newClient({ | ||
region: region, | ||
accessKey: iamCreds.accessKeyId, | ||
invokeUrl: serviceEndpointUri, | ||
region: region, | ||
secretKey: iamCreds.secretAccessKey | ||
@@ -50,9 +50,9 @@ }); | ||
headers: { | ||
Authorization: 'Bearer ' + tokenCreds.idToken | ||
Authorization: "Bearer " + tokenCreds.idToken | ||
} | ||
}; | ||
this.apigClient = apigClientFactory.newClient({ | ||
region: region, | ||
accessKey: '', | ||
invokeUrl: serviceEndpointUri, | ||
region: region, | ||
secretKey: '' | ||
@@ -62,7 +62,7 @@ }); | ||
else { | ||
throw (Error('Unsupported credential type in UserManagementApi')); | ||
throw Error('Unsupported credential type in UserManagementApi'); | ||
} | ||
} | ||
} | ||
UserManagementApi.prototype.createUserPool = function (tenant_id) { | ||
UserManagementApi.prototype.createUserPool = function (tenantId) { | ||
var params = {}; | ||
@@ -72,3 +72,3 @@ var pathTemplate = '/admin/userpools'; | ||
var additionalParams = {}; | ||
var body = { tenant_id: tenant_id }; | ||
var body = { tenant_id: tenantId }; | ||
return this.apigClient.invokeApi(params, pathTemplate, method, additionalParams, body); | ||
@@ -78,3 +78,3 @@ }; | ||
var params = {}; | ||
var pathTemplate = '/admin/userpools/' + id; | ||
var pathTemplate = "/admin/userpools/" + id; | ||
var method = 'DELETE'; | ||
@@ -93,3 +93,3 @@ var additionalParams = {}; | ||
}; | ||
UserManagementApi.prototype.createUser = function (tenant_id, userName, password, firstName, lastName) { | ||
UserManagementApi.prototype.createUser = function (tenantId, userName, password, firstName, lastName) { | ||
var params = {}; | ||
@@ -99,3 +99,3 @@ var pathTemplate = '/admin/users'; | ||
var additionalParams = {}; | ||
var body = { tenant_id: tenant_id, userName: userName, password: password, firstName: firstName, lastName: lastName }; | ||
var body = { userName: userName, password: password, firstName: firstName, lastName: lastName, tenant_id: tenantId }; | ||
return this.apigClient.invokeApi(params, pathTemplate, method, additionalParams, body); | ||
@@ -113,3 +113,3 @@ }; | ||
var params = {}; | ||
var pathTemplate = '/admin/users/' + encodeURIComponent(userName); | ||
var pathTemplate = "/admin/users/" + encodeURIComponent(userName); | ||
var method = 'DELETE'; | ||
@@ -122,3 +122,3 @@ var additionalParams = {}; | ||
var params = {}; | ||
var pathTemplate = '/users/' + encodeURIComponent(userName) + '/pool'; | ||
var pathTemplate = "/users/" + encodeURIComponent(userName) + "/pool"; | ||
var method = 'GET'; | ||
@@ -131,5 +131,4 @@ var additionalParams = {}; | ||
var params = {}; | ||
var pathTemplate = '/users/' + encodeURIComponent(userName) + '/info'; | ||
var pathTemplate = "/users/" + encodeURIComponent(userName) + "/info"; | ||
var method = 'GET'; | ||
// var additionalParams = {}; | ||
var body = {}; | ||
@@ -139,2 +138,3 @@ return this.apigClient.invokeApi(params, pathTemplate, method, this.additionalParams, body); | ||
UserManagementApi.prototype.getUsers = function (firstNameSearch) { | ||
// eslint-disable-line | ||
// TODO: implement search parameters | ||
@@ -144,3 +144,2 @@ var params = {}; | ||
var method = 'GET'; | ||
// var additionalParams = {}; | ||
var body = {}; | ||
@@ -147,0 +146,0 @@ return this.apigClient.invokeApi(params, pathTemplate, method, this.additionalParams, body); |
{ | ||
"name": "@adastradev/user-management-sdk", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Astra user management SDK for JavaScript in the browser and Node.js", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "./node_modules/.bin/tsc", | ||
"build": "tsc", | ||
"test": "nyc mocha --timeout 99999 'test/{unit,integration}/**/*.spec.ts'", | ||
"unit-test": "nyc mocha --timeout 99999 test/unit/**/*.spec.ts", | ||
"test:unit": "nyc mocha test/unit/**/*.spec.ts", | ||
"test:coveralls": "cat coverage/lcov.info | coveralls", | ||
"system-test": "mocha --timeout 99999 test/system/**/*.spec.ts", | ||
"lint": "tslint {source,test}/**/*.ts" | ||
"test:system": "mocha --timeout 99999 test/system/**/*.spec.ts", | ||
"lint": "tslint --project .", | ||
"secure": "gulp secure" | ||
}, | ||
@@ -28,28 +29,33 @@ "repository": { | ||
"dependencies": { | ||
"@adastradev/aws-api-gateway-client": "^0.2.18-beta.1", | ||
"@adastradev/aws-api-gateway-client": "^0.2.18-beta.3", | ||
"@adastradev/serverless-discovery-sdk": "0.0.7", | ||
"amazon-cognito-identity-js": "^3.0.16", | ||
"aws-sdk": "^2.354.0", | ||
"amazon-cognito-identity-js": "^3.1.3", | ||
"aws-sdk": "^2.556.0", | ||
"axios": "^0.19.0", | ||
"node-fetch": "^2.6.0", | ||
"proxy-agent": "^3.0.3" | ||
"proxy-agent": "^3.1.1" | ||
}, | ||
"devDependencies": { | ||
"@istanbuljs/nyc-config-typescript": "^0.1.3", | ||
"@types/chai": "^4.2.0", | ||
"@types/chai": "^4.2.4", | ||
"@types/chai-as-promised": "^7.1.2", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^10.14.15", | ||
"@types/sinon": "^7.0.13", | ||
"@types/node": "^12.11.7", | ||
"@types/sinon": "^7.5.0", | ||
"chai": "^4.2.0", | ||
"chai-as-promised": "^7.1.1", | ||
"coveralls": "^3.0.6", | ||
"mocha": "^5.2.0", | ||
"coveralls": "^3.0.7", | ||
"gulp": "^4.0.2", | ||
"gulp-snyk": "^0.1.1", | ||
"mocha": "^6.2.2", | ||
"nyc": "^14.1.1", | ||
"sinon": "^7.4.1", | ||
"sinon": "^7.5.0", | ||
"snyk": "^1.239.0", | ||
"source-map-support": "^0.5.13", | ||
"ts-node": "^7.0.1", | ||
"tslint": "^5.11.0", | ||
"typescript": "^3.1.6" | ||
"ts-node": "^8.4.1", | ||
"tslint": "^5.20.0", | ||
"tslint-config-airbnb": "^5.11.2", | ||
"tslint-config-security": "^1.16.0", | ||
"typescript": "^3.6.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
320517
59
1614
21
10