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

@availity/env-var

Package Overview
Dependencies
Maintainers
14
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@availity/env-var - npm Package Compare versions

Comparing version 1.10.0 to 1.11.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# 1.11.0 (2020-06-03)
### Features
* **env-var:** add sandbox support to cloud environment ([8ada30c](https://github.com/availity/sdk-js/commit/8ada30cabe64eb95cc37f3b3e0d68444585c0373))
# 1.10.0 (2020-05-20)

@@ -8,0 +19,0 @@

9

lib/index.js

@@ -15,3 +15,3 @@ "use strict";

// where <cloud provider> is a two character abbreviation for the cloud provider
// and zone is a one character abbreviation for prod vs non-prod.
// and zone is a one character abbreviation for prod, non-prod,or sandbox.
// Cloud URIs are in the format /<namespace>/<environment>/...

@@ -24,6 +24,6 @@ // where <namespace> is a three character abbreviation, e.g., cdn or api

if (!(subdomain && pathname)) return null;
var subMatch = subdomain.match(/.*?\.(?:av|aw|gc)(n|p)$/);
var subMatch = subdomain.match(/.*?\.(?:aw|az|gc)(n|p|s)$/);
if (!subMatch) return null;
var pathMatch = pathname.match(/^\/[a-z]{3}\/([a-z0-9]{3})\/.*/);
if (!pathMatch) return null; // ??p domains must be prod, ??n domains can't be prod
if (!pathMatch) return null; // ??p domains must be prod, ??n and ??s domains can't be prod

@@ -37,2 +37,3 @@ var isProdPath = pathMatch[1] === 'prd';

case 'n':
case 's':
return isProdPath ? null : pathMatch[1];

@@ -63,3 +64,3 @@

}, {
regex: /.*?\.(?:av|aw|gc)(n|p)$/,
regex: /.*?\.(?:aw|az|gc)(n|p|s)$/,
fn: getCloudEnv

@@ -66,0 +67,0 @@ }];

{
"name": "@availity/env-var",
"version": "1.10.0",
"version": "1.11.0",
"description": "Availity-specific way to determine variables based on the current environment the code is running in",

@@ -28,3 +28,3 @@ "main": "lib/index.js",

},
"gitHead": "1045201776b1cac4238b5e70972c871a5455f43d"
"gitHead": "f53998c1c73fadb8f752d42e6cbfc7eaa3cebce3"
}
// Cloud domains are in the format <team>.<cloud provider><zone>.availity.com
// where <cloud provider> is a two character abbreviation for the cloud provider
// and zone is a one character abbreviation for prod vs non-prod.
// and zone is a one character abbreviation for prod, non-prod,or sandbox.
// Cloud URIs are in the format /<namespace>/<environment>/...

@@ -11,3 +11,3 @@ // where <namespace> is a three character abbreviation, e.g., cdn or api

const subMatch = subdomain.match(/.*?\.(?:av|aw|gc)(n|p)$/);
const subMatch = subdomain.match(/.*?\.(?:aw|az|gc)(n|p|s)$/);
if (!subMatch) return null;

@@ -18,3 +18,3 @@

// ??p domains must be prod, ??n domains can't be prod
// ??p domains must be prod, ??n and ??s domains can't be prod
const isProdPath = pathMatch[1] === 'prd';

@@ -25,2 +25,3 @@ switch (subMatch[1]) {

case 'n':
case 's':
return isProdPath ? null : pathMatch[1];

@@ -51,3 +52,3 @@ default:

{
regex: /.*?\.(?:av|aw|gc)(n|p)$/,
regex: /.*?\.(?:aw|az|gc)(n|p|s)$/,
fn: getCloudEnv,

@@ -54,0 +55,0 @@ },

@@ -42,27 +42,31 @@ import envVar, { setEnvironments, getSpecificEnv } from '../src';

['digital.awp.availity.com/cdn/prd/spaces/index.html', 'prod'],
['digital.avp.availity.com/cdn/prd/spaces/index.html', 'prod'],
['digital.azp.availity.com/cdn/prd/spaces/index.html', 'prod'],
['digital.gcp.availity.com/cdn/prd/spaces/index.html', 'prod'],
['digital.awn.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.avn.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.aws.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.azn.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.gcn.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.awp.availity.com/cdn/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.avp.availity.com/cdn/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.azp.availity.com/cdn/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.gcp.availity.com/cdn/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.awp.availity.com/api/prd/spaces/index.html', 'prod'],
['digital.avp.availity.com/api/prd/spaces/index.html', 'prod'],
['digital.azp.availity.com/api/prd/spaces/index.html', 'prod'],
['digital.gcp.availity.com/api/prd/spaces/index.html', 'prod'],
['digital.awn.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.avn.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.aws.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.azn.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.gcn.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.awp.availity.com/api/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.avp.availity.com/api/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.azp.availity.com/api/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.gcp.availity.com/api/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.gap.availity.com/api/prd/spaces/index.html', 'local'], // Unrecognized cloud
['digital.avp.availity.com/apic/prd/spaces/index.html', 'local'], // Unrecognized namespace
['digital.avp.availity.com/api/prod/spaces/index.html', 'local'], // Unrecognized environment
['digital.azp.availity.com/apic/prd/spaces/index.html', 'local'], // Unrecognized namespace
['digital.azp.availity.com/api/prod/spaces/index.html', 'local'], // Unrecognized environment
['digital.awn.availity.com/cdn/stg/spaces/index.html', 'qa'],
['digital.avn.availity.com/cdn/qua/spaces/index.html', 'qa'],
['digital.aws.availity.com/cdn/stg/spaces/index.html', 'qa'],
['digital.azn.availity.com/cdn/qua/spaces/index.html', 'qa'],
['digital.gcn.availity.com/cdn/qap/spaces/index.html', 'qa'],
['digital.awn.availity.com/cdn/tst/spaces/index.html', 'test'],
['digital.avn.availity.com/cdn/t01/spaces/index.html', 'test'],
['digital.aws.availity.com/cdn/tst/spaces/index.html', 'test'],
['digital.azn.availity.com/cdn/t01/spaces/index.html', 'test'],
['digital.gcn.availity.com/cdn/t25/spaces/index.html', 'test'],

@@ -132,2 +136,12 @@ ].forEach(args => {

],
[
'apps.availity.com',
'qa',
getFakeWindowLocation('bar.aws.availity.com', '/cdn/q01/index.html'),
],
[
'apps.availity.com',
'test',
getFakeWindowLocation('bar.aws.availity.com', '/cdn/tst/index.html'),
],
].forEach(args => {

@@ -185,2 +199,7 @@ generateTest(...args);

],
[
'foo.awp.availity.com/cdn/prd/spaces/index.html',
'qa',
'https://foo.aws.availity.com/api/stg/spaces/index.html',
],
].forEach(args => {

@@ -339,31 +358,37 @@ generateTest(...args);

['digital.awp.availity.com/cdn/prd/spaces/index.html', 'prd'],
['digital.avp.availity.com/cdn/prd/spaces/index.html', 'prd'],
['digital.azp.availity.com/cdn/prd/spaces/index.html', 'prd'],
['digital.gcp.availity.com/cdn/prd/spaces/index.html', 'prd'],
['digital.awn.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.avn.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.aws.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.azn.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.gcn.availity.com/cdn/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.awp.availity.com/cdn/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.avp.availity.com/cdn/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.azp.availity.com/cdn/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.gcp.availity.com/cdn/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.awp.availity.com/api/prd/spaces/index.html', 'prd'],
['digital.avp.availity.com/api/prd/spaces/index.html', 'prd'],
['digital.azp.availity.com/api/prd/spaces/index.html', 'prd'],
['digital.gcp.availity.com/api/prd/spaces/index.html', 'prd'],
['digital.awn.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.avn.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.aws.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.azn.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.gcn.availity.com/api/prd/spaces/index.html', 'local'], // Non-prod domain, prod URI
['digital.awp.availity.com/api/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.avp.availity.com/api/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.azp.availity.com/api/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.gcp.availity.com/api/tst/spaces/index.html', 'local'], // Prod domain, non-prod URI
['digital.gap.availity.com/api/prd/spaces/index.html', 'local'], // Unrecognized cloud
['digital.avp.availity.com/apic/prd/spaces/index.html', 'local'], // Unrecognized namespace
['digital.avp.availity.com/api/prod/spaces/index.html', 'local'], // Unrecognized environment
['digital.azp.availity.com/apic/prd/spaces/index.html', 'local'], // Unrecognized namespace
['digital.azp.availity.com/api/prod/spaces/index.html', 'local'], // Unrecognized environment
['digital.awn.availity.com/cdn/stg/spaces/index.html', 'stg'],
['digital.avn.availity.com/cdn/qua/spaces/index.html', 'qua'],
['digital.aws.availity.com/cdn/stg/spaces/index.html', 'stg'],
['digital.azn.availity.com/cdn/qua/spaces/index.html', 'qua'],
['digital.gcn.availity.com/cdn/qap/spaces/index.html', 'qap'],
['digital.awn.availity.com/cdn/tst/spaces/index.html', 'tst'],
['digital.avn.availity.com/cdn/t01/spaces/index.html', 't01'],
['digital.aws.availity.com/cdn/tst/spaces/index.html', 'tst'],
['digital.azn.availity.com/cdn/t01/spaces/index.html', 't01'],
['digital.gcn.availity.com/cdn/t25/spaces/index.html', 't25'],
['digital.box.availity.com/cdn/t25/spaces/index.html', 'local'],
['digital.awn.availity.com/cdn/apple/spaces/index.html', 'local'],
['digital.aws.availity.com/cdn/apple/spaces/index.html', 'local'],
['digital.awn.availity.com/nahfam/stg/spaces/index.html', 'local'],
['digital.aws.availity.com/nahfam/stg/spaces/index.html', 'local'],
].forEach(args => {

@@ -370,0 +395,0 @@ generateSpecificTest(...args);

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