1.0.1 • Published 5 years ago

@servisbot/npm-sb-srn v1.0.1

Weekly downloads
6,505
License
UNLICENSED
Repository
github
Last release
5 years ago

npm-sb-srn

SRN generation SDK

Overview

npm module to make SRNs "painless"

install

npm install --save @servisbot/npm-sb-srn

Usage

const SRN = require('@servisbot/npm-sb-srn');

const srn = new SRN(args);  // see Environment variables section
assert(srn.isValid());

const srn = SRN.fromString('srn:vault:global:myorg:secretdoc:my-secret-doc-name:78');
assert.equal(srn.getService(), 'vault');
assert.equal(srn.getRegion(), 'global');
assert.equal(srn.getOrganization(), 'myorg');
assert.equal(srn.getResourcetype(), 'secretdoc');
assert.equal(srn.getResource(), 'my-secret-doc-name');
assert.equal(srn.getQualifier(), '78');
assert.equal(srn.generateSRN(), 'srn:vault:global:myorg:secretdoc:my-secret-doc-name:78');

Environment variables

The following environemnt variables will be used if present

SB_SERVICE;
SB_REGION;
SB_RESOURCE_TYPE;
SB_ORGANIZATION;
SB_RESOURCE;
SB_QUALIFIER;

The SRN class will read from the args passed into the constructure and take precidence over env vars if they exist

{
    service,
    region,
    resourcetype,
    organization,
    resource,
    qualifier
}
1.0.1

5 years ago

1.0.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago