Comparing version 0.0.4 to 0.0.5
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.BAAPIClient = exports.OAAPIClient = exports.Double = exports.BigInt = exports.Credentials = undefined; | ||
exports.BAAPIClient = exports.OAAPIClient = undefined; | ||
@@ -23,4 +23,2 @@ var _url = require('url'); | ||
var _types = require('./types.js'); | ||
var _credentials = require('../util/credentials.js'); | ||
@@ -35,2 +33,4 @@ | ||
}, | ||
PROTOCOL_HTTP = 'http:', | ||
PROTOCOL_HTTPS = 'https:', | ||
HTTP_PORT = '80', | ||
@@ -50,3 +50,3 @@ HTTPS_PORT = '443', | ||
static makeProxy(client, prefixesChecker, applyHandler) { | ||
static _makeProxy(client, prefixesChecker, applyHandler) { | ||
if (!(client instanceof APIClient)) { | ||
@@ -93,18 +93,29 @@ throw new Error('\'client\' must be an instance of \'APIClient\''); | ||
constructor(options, credentials) { | ||
constructor(url, options, credentials) { | ||
this._options = { headers: { 'User-Agent': USER_AGENT } }; | ||
if (_util2.default.isString(options)) { | ||
Object.assign(this._options, (0, _url.parse)(options)); | ||
} else if (_util2.default.isObject(options)) { | ||
if (_util2.default.isObject(url)) { | ||
credentials = options; | ||
options = url; | ||
url = undefined; | ||
} | ||
if (!(_util2.default.isObject(options) && !(options instanceof _credentials2.default))) { | ||
credentials = options; | ||
options = undefined; | ||
} | ||
if (_util2.default.isObject(options)) { | ||
Object.assign(this._options, options); | ||
} else { | ||
throw new Error('\'options\' must be an object or a string'); | ||
} | ||
const { protocol, hostname } = this._options; | ||
let port = this._options.port; | ||
if (_util2.default.isString(url)) { | ||
Object.assign(this._options, (0, _url.parse)(url)); | ||
} | ||
options = this._options; | ||
const { protocol = PROTOCOL_HTTP, hostname } = options; | ||
let port = options.port = String(options.port); | ||
if (!_util2.default.isNonEmptyString(hostname)) { | ||
@@ -114,11 +125,13 @@ throw new Error('No hostname was provided'); | ||
if (protocol !== 'http:' && protocol !== 'https:') { | ||
throw new Error(`Only HTTP and HTTPS protocols are supported, specified: '${protocol}'`); | ||
if (protocol !== PROTOCOL_HTTP && protocol !== PROTOCOL_HTTPS) { | ||
throw new Error(`Only HTTP and HTTPS protocols are supported`); | ||
} | ||
if (!port || !_util2.default.isTCPPort(parseInt(port, 10))) { | ||
port = protocol === 'http:' ? HTTP_PORT : HTTPS_PORT; | ||
const isHttp = protocol === PROTOCOL_HTTP; | ||
if (!_util2.default.isTCPPort(parseInt(port, 10))) { | ||
options.port = isHttp ? HTTP_PORT : HTTPS_PORT; | ||
} | ||
this._client = protocol === 'http:' ? _xmlrpc2.default.createClient(options) : _xmlrpc2.default.createSecureClient(options); | ||
this._client = isHttp ? _xmlrpc2.default.createClient(options) : _xmlrpc2.default.createSecureClient(options); | ||
this.credentials = credentials; | ||
@@ -172,8 +185,6 @@ } | ||
constructor(options, credentials) { | ||
super(options, credentials); | ||
constructor(url, options, credentials) { | ||
super(url, options, credentials); | ||
this.credentials = credentials; | ||
return APIClient.makeProxy(this, prefixes => { | ||
return APIClient._makeProxy(this, prefixes => { | ||
if (prefixes.length === 3) { | ||
@@ -187,10 +198,2 @@ throw new Error('OA API methods do not have that many parts'); | ||
get credentials() { | ||
return super.credentials; | ||
} | ||
set credentials(credentials) { | ||
super.credentials = credentials; | ||
} | ||
call(name, args) { | ||
@@ -222,6 +225,6 @@ const credentials = this.credentials, | ||
constructor(options, credentials) { | ||
super(options, credentials); | ||
constructor(url, options, credentials) { | ||
super(url, options, credentials); | ||
return APIClient.makeProxy(this, prefixes => { | ||
return APIClient._makeProxy(this, prefixes => { | ||
if (prefixes.length === 2) { | ||
@@ -235,10 +238,2 @@ throw new Error('BA API methods do not have that many parts'); | ||
get credentials() { | ||
return super.credentials; | ||
} | ||
set credentials(credentials) { | ||
super.credentials = credentials; | ||
} | ||
call(prefix, name, ...args) { | ||
@@ -261,3 +256,3 @@ const execParams = { | ||
return super.call('Execute', [execParams]).catch(error => { | ||
if (_util2.default.isString(error.faultString) && _util2.default.isBase64(error.faultString)) { | ||
if (_util2.default.isBase64(error.faultString)) { | ||
const encoded = error.faultString, | ||
@@ -276,7 +271,4 @@ decoded = new Buffer(encoded, 'base64').toString(); | ||
exports.Credentials = _credentials2.default; | ||
exports.BigInt = _types.BigInt; | ||
exports.Double = _types.Double; | ||
exports.OAAPIClient = OAAPIClient; | ||
exports.BAAPIClient = BAAPIClient; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvYXBpL2NsaWVudHMuanMiXSwibmFtZXMiOlsiUlgiLCJPQV9XUk9OR19DUkVEU19SRVNQT05TRSIsIkhUVFBfUE9SVCIsIkhUVFBTX1BPUlQiLCJVU0VSX0FHRU5UIiwiQVBJQ2xpZW50IiwiY3JlYXRlQXV0aEhlYWRlciIsInVzZXJuYW1lIiwicGFzc3dvcmQiLCJpc05vbkVtcHR5U3RyaW5nIiwiRXJyb3IiLCJCdWZmZXIiLCJpc1N0cmluZyIsInRvU3RyaW5nIiwibWFrZVByb3h5IiwiY2xpZW50IiwicHJlZml4ZXNDaGVja2VyIiwiYXBwbHlIYW5kbGVyIiwiaXNGdW5jdGlvbiIsInByb3h5QVBJTWV0aG9kUGFydCIsInRhcmdldCIsImtleSIsImlnbm9yZVByZXNlbnQiLCJQcm94eSIsImdldCIsIlJlZmxlY3QiLCJjYWxsIiwiX3ByZWZpeGVzIiwiT2JqZWN0IiwiYXNzaWduIiwiY29uY2F0IiwiYXBwbHkiLCJ0aGlzQXJnIiwiYXJndW1lbnRMaXN0IiwiY29uc3RydWN0b3IiLCJvcHRpb25zIiwiY3JlZGVudGlhbHMiLCJfb3B0aW9ucyIsImhlYWRlcnMiLCJpc09iamVjdCIsInByb3RvY29sIiwiaG9zdG5hbWUiLCJwb3J0IiwiaXNUQ1BQb3J0IiwicGFyc2VJbnQiLCJfY2xpZW50IiwiY3JlYXRlQ2xpZW50IiwiY3JlYXRlU2VjdXJlQ2xpZW50IiwiX2NyZWRlbnRpYWxzIiwib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mIChjcmVkZW50aWFscy5wYXNzd29yZCAhPT0gbnVsbCkge1xuICAgICAgICBleGVjUGFyYW1zLlBhc3N3b3JkID0gY3JlZGVudGlhbHMucGFzc3dvcmQ7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHN1cGVyLmNhbGwoJ0V4ZWN1dGUnLCBbZXhlY1BhcmFtc10pLmNhdGNoKGVycm9yID0+IHtcbiAgICAgIGlmICh1dGlsLmlzU3RyaW5nKGVycm9yLmZhdWx0U3RyaW5nKSAmJiB1dGlsLmlzQmFzZTY0KGVycm9yLmZhdWx0U3RyaW5nKSkge1xuICAgICAgICBjb25zdCBlbmNvZGVkID0gZXJyb3IuZmF1bHRTdHJpbmcsXG4gICAgICAgICAgZGVjb2RlZCA9IG5ldyBCdWZmZXIoZW5jb2RlZCwgJ2Jhc2U2NCcpLnRvU3RyaW5nKCk7XG5cbiAgICAgICAgZXJyb3IuZmF1bHRTdHJpbmcgPSBkZWNvZGVkO1xuICAgICAgICBlcnJvci5tZXNzYWdlID0gZXJyb3IubWVzc2FnZS5yZXBsYWNlKGVuY29kZWQsIGRlY29kZWQpO1xuICAgICAgICBlcnJvci5zdGFjayA9IGVycm9yLnN0YWNrLnJlcGxhY2UoZW5jb2RlZCwgZGVjb2RlZCk7XG4gICAgICB9XG5cbiAgICAgIHRocm93IGVycm9yO1xuICAgIH0pO1xuICB9XG59XG5cbmV4cG9ydCB7IENyZWRlbnRpYWxzLCBCaWdJbnQsIERvdWJsZSwgT0FBUElDbGllbnQsIEJBQVBJQ2xpZW50IH07XG4iXX0= | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvYXBpL2NsaWVudHMuanMiXSwibmFtZXMiOlsiUlgiLCJPQV9XUk9OR19DUkVEU19SRVNQT05TRSIsIlBST1RPQ09MX0hUVFAiLCJQUk9UT0NPTF9IVFRQUyIsIkhUVFBfUE9SVCIsIkhU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N0LmdldCh0YXJnZXQsIGtleSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbmV3IFByb3h5KGNsaWVudC5jYWxsLCB7XG4gICAgICAgICAgX3ByZWZpeGVzOiBbIGtleSBdLFxuXG4gICAgICAgICAgZ2V0KHRhcmdldCwga2V5KSB7XG4gICAgICAgICAgICBpZiAocHJveHlBUElNZXRob2RQYXJ0KHRhcmdldCwga2V5KSAmJiBwcmVmaXhlc0NoZWNrZXIodGhpcy5fcHJlZml4ZXMpKSB7XG4gICAgICAgICAgICAgIHJldHVybiBuZXcgUHJveHkodGFyZ2V0LCBPYmplY3QuYXNzaWduKHt9LCB0aGlzLCB7IF9wcmVmaXhlczogdGhpcy5fcHJlZml4ZXMuY29uY2F0KGtleSkgfSkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gUmVmbGVjdC5nZXQodGFyZ2V0LCBrZXkpO1xuICAgICAgICAgIH0sXG5cbiAgICAgICAgICBhcHBseSh0YXJnZXQsIHRoaXNBcmcsIGFyZ3VtZW50TGlzdCkge1xuICAgICAgICAgICAgcmV0dXJuIGFwcGx5SGFuZGxlcih0aGlzLl9wcmVmaXhlcywgLi4uYXJndW1lbnRMaXN0KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH0pO1xuICB9XG5cbiAgX29wdGlvbnMgPSB7IGhlYWRlcnM6IHsgJ1VzZXItQWdlbnQnOiBVU0VSX0FHRU5UIH19O1xuXG4gIGNvbnN0cnVjdG9yKHVybCwgb3B0aW9ucywgY3JlZGVudGlhbHMpIHtcbiAgICBpZiAodXRpbC5pc09iamVjdCh1cmwpKSB7XG4gICAgICBjcmVkZW50aWFscyA9IG9wdGlvbnM7XG4gICAgICBvcHRpb25zID0gdXJsO1xuICAgICAgdXJsID0gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGlmICghKHV0aWwuaXNPYmplY3Qob3B0aW9ucykgJiYgIShvcHRpb25zIG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ICAgICBlcnJvci5tZXNzYWdlID0gZXJyb3IubWVzc2FnZS5yZXBsYWNlKGVuY29kZWQsIGRlY29kZWQpO1xuICAgICAgICBlcnJvci5zdGFjayA9IGVycm9yLnN0YWNrLnJlcGxhY2UoZW5jb2RlZCwgZGVjb2RlZCk7XG4gICAgICB9XG5cbiAgICAgIHRocm93IGVycm9yO1xuICAgIH0pO1xuICB9XG59XG5cbmV4cG9ydCB7IE9BQVBJQ2xpZW50LCBCQUFQSUNsaWVudCB9O1xuIl19 |
@@ -31,5 +31,4 @@ 'use strict'; | ||
const BEGIN_PRIVATE_KEY = '-----BEGIN RSA PRIVATE KEY-----', | ||
USER_AGENT = 'OSACtl APSC HTTP Client', | ||
APS_TOKEN_HEADER_NAME = 'APS-Token'; | ||
const PEM_KEY_START = '-----BEGIN RSA PRIVATE KEY-----', | ||
USER_AGENT = 'OSACtl APSC HTTP Client'; | ||
@@ -41,3 +40,3 @@ class APSSession { | ||
if (!_util2.default.isValidFQURL(url)) { | ||
if (!_util2.default.isFQURL(url)) { | ||
throw new Error('\'url\' must be a valid fully qualified URL'); | ||
@@ -63,2 +62,6 @@ } | ||
set ready(_) { | ||
throw new Error('Readiness cannot be changed directly'); | ||
} | ||
get ready() { | ||
@@ -68,6 +71,2 @@ return this._ready; | ||
set ready(_) { | ||
throw new Error('Readiness cannot be changed directly'); | ||
} | ||
defaults(options) { | ||
@@ -81,2 +80,14 @@ this._request = this._request.defaults(options); | ||
if (this.ready.isFulfilled()) { | ||
options = Object.assign({}, options); | ||
if (this.authorization instanceof _token2.default) { | ||
if ('headers' in options) { | ||
options.headers['APS-Token'] = this.authorization.token; | ||
} else { | ||
options.headers = { 'APS-Token': this.authorization.token }; | ||
} | ||
} else { | ||
Object.assign(options, this.authorization); | ||
} | ||
return new _bluebird2.default((resolve, reject) => { | ||
@@ -125,6 +136,2 @@ this._request(options, (error, incomingMessage) => { | ||
_tokenUpdated() { | ||
this._request = this._request.defaults({ headers: { [APS_TOKEN_HEADER_NAME]: this.authorization.token } }); | ||
} | ||
set authorization(authorization) { | ||
@@ -137,3 +144,2 @@ if (authorization instanceof _token2.default || _util2.default.isString(authorization) && _token2.default.isValidToken(authorization)) { | ||
this._authorization = authorization; | ||
this._tokenUpdated(); | ||
@@ -149,14 +155,12 @@ return this; | ||
this._authorization = authorization; | ||
this._tokenUpdated(); | ||
} else if (_util2.default.isString(authorization)) { | ||
this._ready = readFile(authorization, { encoding: 'utf-8' }).then(file => { | ||
const parts = file.split(BEGIN_PRIVATE_KEY).filter(({ length }) => length > 0); | ||
if (parts.length !== 2) { | ||
if (!_util2.default.isPEMCertificateAndKey(file)) { | ||
throw new Error('Certificate file seems to be invalid, make sure it\'s in the format accepted by \'curl -E\''); | ||
} | ||
parts[1] = BEGIN_PRIVATE_KEY + parts[1]; | ||
const parts = file.split(PEM_KEY_START); | ||
parts[1] = PEM_KEY_START + parts[1]; | ||
this._authorization = { cert: parts[0], key: parts[1] }; | ||
this._request = this._request.defaults(this._authorization); | ||
@@ -187,3 +191,3 @@ return this; | ||
return token.update().then(() => this._tokenUpdated()); | ||
return token.update(); | ||
} | ||
@@ -193,2 +197,2 @@ } | ||
exports.default = APSSession; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvYXBzL3Nlc3Npb24uanMiXSwibmFtZXMiOlsicmVhZEZpbGUiLCJwcm9taXNpZnkiLCJCRUdJTl9QUklWQVRFX0tFWSIsIlVTRVJfQUdFTlQiLCJBUFNfVE9LRU5fSEVBREVSX05BTUUiLCJBUFNTZXNzaW9uIiwiY29uc3RydWN0b3IiLCJ1cmwiLCJhdXRob3JpemF0aW9uIiwiX3JlYWR5IiwicmVzb2x2ZSIsImlzVmFsaWRGUVVSTCIsIkVycm9yIiwiX3VybCIsInJlcXVlc3RJbnN0YW5jZSIsIl9yZXF1ZXN0IiwiZGVmYXVsdHMiLCJiYXNlVXJsIiwiaGVhZGVyc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pbmcgYW4gQVBTIHRva2VuIG9yIGEgcGF0aCB0byBhIGNsaWVudCBjZXJ0aWZpY2F0ZScpO1xuICAgIH1cbiAgfVxuXG4gIGdldCBhdXRob3JpemF0aW9uKCkge1xuICAgIHJldHVybiB0aGlzLl9hdXRob3JpemF0aW9uO1xuICB9XG5cbiAgdXBkYXRlVG9rZW4oKSB7XG4gICAgY29uc3QgdG9rZW4gPSB0aGlzLmF1dGhvcml6YXRpb247XG5cbiAgICBpZiAoISh0b2tlbiBpbnN0YW5jZW9mIEFQU1Rva2VuKSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdUaGlzIHNlc3Npb24gZG9lcyBub3QgdXNlIEFQUyB0b2tlbiBmb3IgYXV0aG9yaXphdGlvbicpO1xuICAgIH1cblxuICAgIGlmICghdG9rZW4uaXNVcGRhdGFibGUpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcignVGhpcyBzZXNzaW9uXFwncyB0b2tlbiBjYW5ub3QgYmUgdXBkYXRlZCcpO1xuICAgIH1cblxuICAgIHJldHVybiB0b2tlbi51cGRhdGUoKTtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBBUFNTZXNzaW9uO1xuIl19 |
@@ -141,3 +141,3 @@ 'use strict'; | ||
set token(_) { | ||
throw new Error('Token cannot be changed directly'); | ||
throw new Error('Token cannot be changed directly, use \'#update\''); | ||
} | ||
@@ -150,3 +150,3 @@ | ||
set controllerURL(_) { | ||
throw new Error('Controller URL cannot be changed directly'); | ||
throw new Error('Controller URL cannot be changed directly, use \'#update\''); | ||
} | ||
@@ -159,3 +159,3 @@ | ||
set parent(_) { | ||
throw new Error('Parent cannot be changed after instantiation'); | ||
throw new Error('Parent cannot be changed after instantiation, supply it as a third argument to the constructor'); | ||
} | ||
@@ -168,3 +168,3 @@ | ||
set updated(_) { | ||
throw new Error('Creation time cannot be changed directly'); | ||
throw new Error('Creation time cannot be changed directly, use \'#update\''); | ||
} | ||
@@ -177,3 +177,3 @@ | ||
set parameters(_) { | ||
throw new Error('Parameters cannot be changed after instantiation'); | ||
throw new Error('Parameters cannot be changed after instantiation, supply it as a second argument to the constructor'); | ||
} | ||
@@ -186,3 +186,3 @@ | ||
set key(_) { | ||
throw new Error('Token key cannot be changed after instantiation'); | ||
throw new Error('Token key cannot be changed after instantiation, it is calculated from the token type and parameters'); | ||
} | ||
@@ -195,3 +195,3 @@ | ||
set isValid(_) { | ||
throw new Error('Validity cannot be changed directly'); | ||
throw new Error('Validity cannot be changed directly, supply a string containing a valid token as a first argument to the constructor'); | ||
} | ||
@@ -204,3 +204,3 @@ | ||
set isUpdatable(_) { | ||
throw new Error('Updatability cannot be changed directly'); | ||
throw new Error('Updatability cannot be changed directly, supply a valid \'OSACtl\' or \'OAAPIClient\' instance as a third argument to the constructor'); | ||
} | ||
@@ -266,2 +266,2 @@ | ||
exports.default = APSToken; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvYXBzL3Rva2VuLmpzIl0sIm5hbWVzIjpbIlRPS0VOX0hFQURFUiIsIkFQU1Rva2VuIiwiVFlQRVMiLCJfIiwiRXJyb3IiLCJPYmplY3QiLCJhc3NpZ24iLCJfVFlQRVMiLCJpc1ZhbGlkVG9rZW4iLCJzdHJpbmciLCJpc0Jhc2U2NCIsImRlY29kZWQiLCJCdWZmZXIiLCJ0b1N0cmluZyIsInBhcnRzIiwic3BsaXQiLCJsZW5ndGgiLCJmcm9tQVBJIiwiYXBpIiwicGFyYW1ldGVycyIsInRva2VuIiwidXBkYXRlIiwiY29uc3RydWN0b3IiLCJwYXJlbnQiLCJfdG9rZW4iLCJfY29udHJvbGxlclVSTCIsIl9wYXJlbnQiLCJfdXBkYXRlZCIsIl9wYXJhbWV0ZXJzIiwiX2tleSIsImNvbnRyb2xsZXJVUkwiLCJ1cGRhdGVkIiwiX3VwZGF0ZSIsImlzTnVsbCIsIkRhdGUiLCJpc1VuZGVm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1Y3Rvcih0aGlzKTtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBBUFNUb2tlbjtcbiJdfQ== |
@@ -27,3 +27,3 @@ 'use strict'; | ||
if (!_util2.default.isValidFQURL(cpURL)) { | ||
if (!_util2.default.isFQURL(cpURL)) { | ||
throw new Error('\'cpURL\' must be a valid fully qualified URL'); | ||
@@ -42,2 +42,2 @@ } | ||
exports.default = Session; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvY3Avc2Vzc2lvbi5qcyJdLCJuYW1lcyI6WyJTZXNzaW9uIiwiY29uc3RydWN0b3IiLCJidWlsZGVyIiwiY3BVUkwiLCJpc0Z1bmN0aW9uIiwiYnVpbGQiLCJFcnJvciIsImlzVmFsaWRGUVVSTCIsImRyaXZlciIsImdldCIsImVuZCIsInF1aXQiXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBOzs7O0FBRUE7Ozs7QUFDQTs7Ozs7O0FBRUEsTUFBTUEsT0FBTixDQUFjO0FBQ1pDLGNBQVlDLE9BQVosRUFBcUJDLEtBQXJCLEVBQTRCO0FBQzFCLFFBQUksQ0FBQyxlQUFLQyxVQUFMLENBQWdCRixRQUFRRyxLQUF4QixDQUFMLEVBQXFDO0FBQ25DLFlBQU0sSUFBSUMsS0FBSixDQUFVLGdEQUFWLENBQU47QUFDRDs7QUFFRCxRQUFJLENBQUMsZUFBS0MsWUFBTCxDQUFrQkosS0FBbEIsQ0FBTCxFQUErQjtBQUM3QixZQUFNLElBQUlHLEtBQUosQ0FBVSwrQ0FBVixDQUFOO0FBQ0Q7O0FBRUQsU0FBS0UsTUFBTCxHQUFjTixRQUFRRyxLQUFSLEVBQWQ7QUFDQSxTQUFLRyxNQUFMLENBQVlDLEdBQVosQ0FBZ0JOLEtBQWhCO0FBQ0Q7O0FBRURPLFFBQU07QUFDSixTQUFLRixNQUFMLENBQVlHLElBQVo7QUFDRD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EgU2VsZW5pdW0gYnJvd3NlciBidWlsZGVyJyk7XG4gICAgfVxuXG4gICAgaWYgKCF1dGlsLmlzRlFVUkwoY3BVUkwpKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ1xcJ2NwVVJMXFwnIG11c3QgYmUgYSB2YWxpZCBmdWxseSBxdWFsaWZpZWQgVVJMJyk7XG4gICAgfVxuXG4gICAgdGhpcy5kcml2ZXIgPSBidWlsZGVyLmJ1aWxkKCk7XG4gICAgdGhpcy5kcml2ZXIuZ2V0KGNwVVJMKTtcbiAgfVxuXG4gIGVuZCgpIHtcbiAgICB0aGlzLmRyaXZlci5xdWl0KCk7XG4gIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgU2Vzc2lvbjtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _events = require('events'); | ||
var _events2 = _interopRequireDefault(_events); | ||
var _bluebird = require('bluebird'); | ||
var _bluebird2 = _interopRequireDefault(_bluebird); | ||
var _ssh = require('ssh2'); | ||
@@ -7,13 +19,253 @@ | ||
var _ = require(''); | ||
var _util = require('../util/util.js'); | ||
var _2 = _interopRequireDefault(_); | ||
var _util2 = _interopRequireDefault(_util); | ||
var _credentials = require('../util/credentials.js'); | ||
var _credentials2 = _interopRequireDefault(_credentials); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
class SSHSession { | ||
constructor(host, port, credentials) {} | ||
const DEFAULTS = { | ||
ENCODING: 'utf-8', | ||
USERNAME: 'root', | ||
PORT: 22 | ||
}; | ||
exec(command) {} | ||
class SSHSession extends _events2.default { | ||
constructor(host, port, credentials) { | ||
super(); | ||
this._client = new _ssh2.default.Client(); | ||
if (!port || port instanceof _credentials2.default) { | ||
credentials = port; | ||
port = undefined; | ||
} | ||
if (!_util2.default.isNonEmptyString(host)) { | ||
throw new Error('\'host\' must be a non-empty string'); | ||
} | ||
port = parseInt(port, 10); | ||
if (!_util2.default.isTCPPort(port)) { | ||
port = DEFAULTS.PORT; | ||
} | ||
if (!(credentials instanceof _credentials2.default)) { | ||
credentials = new _credentials2.default(DEFAULTS.USERNAME); | ||
} | ||
this._client.shellAsync = _bluebird2.default.promisify(this._client.shell); | ||
this._client.execAsync = _bluebird2.default.promisify(this._client.exec); | ||
this._client.sftpAsync = _bluebird2.default.promisify(this._client.sftp); | ||
const options = { | ||
host, | ||
port, | ||
username: credentials.username, | ||
password: credentials.password | ||
}; | ||
const clientReady = new _bluebird2.default((resolve, reject) => { | ||
this._client.on('error', reject).on('ready', () => resolve()).connect(options); | ||
}); | ||
this._ready = clientReady.then(() => this._client.shellAsync()).then(shell => { | ||
shell.writeAsync = _bluebird2.default.promisify(shell.write); | ||
shell.endAsync = _bluebird2.default.promisify(shell.end); | ||
shell.on('error', error => this.emit('error', error)).on('close', () => { | ||
this.emit('close'); | ||
this._shellIsClosed = true; | ||
}).on('finish', () => { | ||
this.emit('finish'); | ||
this._shellIsClosed = true; | ||
}).on('data', data => this.emit('stdout', data)).stderr.on('data', data => this.emit('stderr', data)); | ||
this._shell = shell; | ||
this._shellIsClosed = false; | ||
this.readEncoding = DEFAULTS.ENCODING; | ||
this.writeEncoding = DEFAULTS.ENCODING; | ||
return this; | ||
}); | ||
this._sftpReady = clientReady.then(() => this._client.sftpAsync()).then(sftp => { | ||
sftp.fastGetAsync = _bluebird2.default.promisify(sftp.fastGet); | ||
sftp.fastPutAsync = _bluebird2.default.promisify(sftp.fastPut); | ||
this._sftp = sftp; | ||
return this; | ||
}); | ||
} | ||
set ready(_) { | ||
throw new Error('Readiness cannot be changed directly'); | ||
} | ||
get ready() { | ||
return this._ready; | ||
} | ||
set sftpReady(_) { | ||
throw new Error('SFTP readiness cannot be changed directly'); | ||
} | ||
get sftpReady() { | ||
return this._sftpReady; | ||
} | ||
set readEncoding(encoding) { | ||
if (!this.ready.isFulfilled()) { | ||
this.ready.then(() => this.readEncoding = encoding); | ||
} | ||
this._shell.setEncoding(encoding); | ||
this._shell.stderr.setEncoding(encoding); | ||
this._readEncoding = encoding; | ||
} | ||
get readEncoding() { | ||
return this._readEncoding; | ||
} | ||
set writeEncoding(encoding) { | ||
if (!this.ready.isFulfilled()) { | ||
this.ready.then(() => this.writeEncoding = encoding); | ||
} | ||
this._shell.setDefaultEncoding(encoding); | ||
this._writeEncoding = encoding; | ||
} | ||
get writeEncoding() { | ||
return this._writeEncoding; | ||
} | ||
send(data, encoding) { | ||
if (!this.ready.isFulfilled()) { | ||
return this.ready.then(() => this.send(text)); | ||
} | ||
return this._shell.writeAsync(data, encoding); | ||
} | ||
signal(name) { | ||
if (!this.ready.isFulfilled()) { | ||
return this.ready.then(() => this.signal(name)); | ||
} | ||
return this._shell.signal(name); | ||
} | ||
exec(command, options) { | ||
if (!this.ready.isFulfilled()) { | ||
return this.ready.then(() => this.exec(command, options)); | ||
} | ||
let encoding = DEFAULTS.ENCODING; | ||
if (_util2.default.isObject(options)) { | ||
options = Object.assign({}, options); | ||
if ('encoding' in options) { | ||
if (options.encoding && _util2.default.isEncoding(options.encoding)) { | ||
encoding = options.encoding; | ||
} else { | ||
encoding = null; | ||
} | ||
} | ||
delete options.encoding; | ||
} else { | ||
options = {}; | ||
} | ||
return this._client.execAsync(command, options).then(channel => { | ||
let stdout = [], | ||
stderr = []; | ||
channel.on('data', data => stdout.push(data)).stderr.on('data', data => stderr.push(data)); | ||
return new _bluebird2.default((resolve, reject) => { | ||
channel.on('close', (code, signal) => { | ||
stdout = Buffer.concat(stdout); | ||
stderr = Buffer.concat(stderr); | ||
if (!_util2.default.isNull(encoding)) { | ||
stdout = stdout.toString(DEFAULTS.ENCODING); | ||
stderr = stderr.toString(DEFAULTS.ENCODING); | ||
} | ||
resolve({ code, signal, stdout, stderr }); | ||
}); | ||
}); | ||
}); | ||
} | ||
_writeBuffer(buffer, path) { | ||
return new _bluebird2.default((resolve, reject) => { | ||
this._sftp.createWriteStream(path).on('error', reject).on('finish', resolve).end(buffer); | ||
}); | ||
} | ||
_readBuffer(path) { | ||
return new _bluebird2.default((resolve, reject) => { | ||
const data = []; | ||
this._sftp.createReadStream(path).on('error', reject).on('data', dataPart => data.push(dataPart)).on('end', () => { | ||
resolve(Buffer.concat(data)); | ||
}); | ||
}); | ||
} | ||
upload(source, destination) { | ||
if (!(_util2.default.isNonEmptyString(source) || _util2.default.isBuffer(source))) { | ||
throw new Error('\'source\' must be a \'Buffer\' or a string containing local path'); | ||
} | ||
if (!_util2.default.isNonEmptyString(destination)) { | ||
throw new Error('\'destination\' must be a string containing remote path'); | ||
} | ||
if (!this.sftpReady.isFulfilled()) { | ||
return this.sftpReady.then(() => this.upload(source, destination)); | ||
} | ||
if (_util2.default.isString(source)) { | ||
return this._sftp.fastPutAsync(source, destination); | ||
} | ||
return this._writeBuffer(source, destination); | ||
} | ||
download(source, destination) { | ||
if (!_util2.default.isNonEmptyString(source)) { | ||
throw new Error('\'source\' must be a string containing remote path'); | ||
} | ||
if (!this.sftpReady.isFulfilled()) { | ||
return this.sftpReady.then(() => this.download(source, destination)); | ||
} | ||
if (_util2.default.isNonEmptyString(destination)) { | ||
return this._sftp.fastGetAsync(source, destination); | ||
} | ||
return this._readBuffer(source); | ||
} | ||
end() { | ||
if (!this.ready.isFulfilled() || this._shellIsClosed) { | ||
return _bluebird2.default.resolve(this._client.end()); | ||
} | ||
return this._shell.endAsync().then(() => this._client.end()); | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvaG9zdC9zc2gtc2Vzc2lvbi5qcyJdLCJuYW1lcyI6WyJTU0hTZXNzaW9uIiwiY29uc3RydWN0b3IiLCJob3N0IiwicG9ydCIsImNyZWRlbnRpYWxzIiwiZXhlYyIsImNvbW1hbmQiXSwibWFwcGluZ3MiOiI7O0FBQUE7Ozs7QUFFQTs7Ozs7O0FBRUEsTUFBTUEsVUFBTixDQUFpQjtBQUNmQyxjQUFZQyxJQUFaLEVBQWtCQyxJQUFsQixFQUF3QkMsV0FBeEIsRUFBcUMsQ0FFcEM7O0FBRURDLE9BQUtDLE9BQUwsRUFBYyxDQUNiO0FBTmMiLCJmaWxlIjoic3NoLXNlc3Npb24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3NoMiBmcm9tICdzc2gyJztcblxuaW1wb3J0IENyZWRlbnRpYWxzIGZyb20gJyc7XG5cbmNsYXNzIFNTSFNlc3Npb24ge1xuICBjb25zdHJ1Y3Rvcihob3N0LCBwb3J0LCBjcmVkZW50aWFscykge1xuXG4gIH1cblxuICBleGVjKGNvbW1hbmQpIHtcbiAgfVxufVxuIl19 | ||
exports.default = SSHSession; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvaG9zdC9zc2gtc2Vzc2lvbi5qcyJdLCJuYW1lcyI6WyJERUZBVUxUUyIsIkVOQ09ESU5HIiwiVVNFUk5BTUUiLCJQT1JUIiwiU1NIU2Vzc2lvbiIsImNvbnN0cnVjdG9yIiwiaG9zdCIsInBvcnQiLCJjcmVkZW50aWFscyIsIl9jbGllbnQiLCJDbGllbnQiLCJ1bmRlZmluZWQiLCJpc05vbkVtcHR5U3RyaW5nIiwiRXJyb3IiLCJwYXJzZUludCIsImlzVENQUG9ydCIsInNoZWxsQXN5bmMiLCJwcm9taXNpZnkiLCJzaGVsbCIsImV4ZWNBc3luYyIsImV4ZWMiLCJzZnRwQXN5bmMiLCJzZnRwIiwib3B0aW9ucyIsInVzZXJuYW1lIiwicGFzc3dvcmQiLCJjbGllbnRSZWFkeSIsInJlc29sdmUiLCJyZWplY3QiLCJvbiIsImNvbm5lY3QiLCJfcmVhZHkiLCJ0aGVuIiwid3JpdGVBc3luYyIsIndyaXRlIiwiZW5kQXN5bmMiLCJlbmQiLCJlcnJvciIsImVtaXQiLCJfc2hlbGxJc0Nsb3NlZCIsImRhdGEiLCJ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GUgcGF0aCcpO1xuICAgIH1cblxuICAgIGlmICghdGhpcy5zZnRwUmVhZHkuaXNGdWxmaWxsZWQoKSkge1xuICAgICAgcmV0dXJuIHRoaXMuc2Z0cFJlYWR5LnRoZW4oKCkgPT4gdGhpcy5kb3dubG9hZChzb3VyY2UsIGRlc3RpbmF0aW9uKSk7XG4gICAgfVxuXG4gICAgaWYgKHV0aWwuaXNOb25FbXB0eVN0cmluZyhkZXN0aW5hdGlvbikpIHtcbiAgICAgIHJldHVybiB0aGlzLl9zZnRwLmZhc3RHZXRBc3luYyhzb3VyY2UsIGRlc3RpbmF0aW9uKTtcbiAgICB9XG5cbiAgICByZXR1cm4gdGhpcy5fcmVhZEJ1ZmZlcihzb3VyY2UpO1xuICB9XG5cbiAgZW5kKCkge1xuICAgIGlmICghdGhpcy5yZWFkeS5pc0Z1bGZpbGxlZCgpIHx8IHRoaXMuX3NoZWxsSXNDbG9zZWQpIHtcbiAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fY2xpZW50LmVuZCgpKTtcbiAgICB9XG5cbiAgICByZXR1cm4gdGhpcy5fc2hlbGwuZW5kQXN5bmMoKS50aGVuKCgpID0+IHRoaXMuX2NsaWVudC5lbmQoKSk7XG4gIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgU1NIU2Vzc2lvbjtcbiJdfQ== |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.default = exports.Session = exports.EndpointHost = exports.Host = exports.APSSession = exports.APSToken = exports.BAAPIClient = exports.OAAPIClient = exports.XAPIDouble = exports.XAPIBigInt = exports.Credentials = exports.OSAVersion = exports.OSACtl = undefined; | ||
exports.default = exports.SSHSession = exports.Session = exports.EndpointHost = exports.Host = exports.APSSession = exports.APSToken = exports.BAAPIClient = exports.OAAPIClient = exports.XAPIDouble = exports.XAPIBigInt = exports.Credentials = exports.OSAVersion = exports.OSACtl = undefined; | ||
@@ -75,2 +75,6 @@ var _clients = require('./api/clients.js'); | ||
var _sshSession = require('./host/ssh-session.js'); | ||
var _sshSession2 = _interopRequireDefault(_sshSession); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -86,2 +90,3 @@ | ||
exports.Session = _session4.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL19saWIvbWFpbi5qcyJdLCJuYW1lcyI6WyJCaWdJbnQiLCJEb3VibGUiLCJPQUFQSUNsaWVudCIsIkJBQVBJQ2xpZW50IiwiZGVmYXVsdCIsIk9TQUN0bCIsIk9TQVZlcnNpb24iLCJDcmVkZW50aWFscyIsIkFQU1Rva2VuIiwiQVBTU2Vzc2lvbiIsIkhvc3QiLCJFbmRwb2ludEhvc3QiLCJTZXNzaW9uIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7b0JBR1NBLE07Ozs7OztvQkFBc0JDLE07Ozs7OztvQkFBc0JDLFc7Ozs7OztvQkFBYUMsVzs7Ozs7Ozs7O3dDQU96REMsTzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O1FBVkZDLE07UUFDQUMsVTtRQUNBQyxXO1FBRUFDLFE7UUFDQUMsVTtRQUNBQyxJO1FBQ0FDLFk7UUFDQUMsTyIsImZpbGUiOiJtYWluLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IE9TQUN0bCBmcm9tICcuL29zYS9jdGwuanMnO1xuZXhwb3J0IE9TQVZlcnNpb24gZnJvbSAnLi91dGlsL29zYXZlci5qcyc7XG5leHBvcnQgQ3JlZGVudGlhbHMgZnJvbSAnLi91dGlsL2NyZWRlbnRpYWxzLmpzJztcbmV4cG9ydCB7IEJpZ0ludCBhcyBYQVBJQmlnSW50LCBEb3VibGUgYXMgWEFQSURvdWJsZSwgT0FBUElDbGllbnQsIEJBQVBJQ2xpZW50IH0gZnJvbSAnLi9hcGkvY2xpZ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bImV4cG9ydCBPU0FDdGwgZnJvbSAnLi9vc2EvY3RsLmpzJztcbmV4cG9ydCBPU0FWZXJzaW9uIGZyb20gJy4vdXRpbC9vc2F2ZXIuanMnO1xuZXhwb3J0IENyZWRlbnRpYWxzIGZyb20gJy4vdXRpbC9jcmVkZW50aWFscy5qcyc7XG5leHBvcnQgeyBCaWdJbnQgYXMgWEFQSUJpZ0ludCwgRG91YmxlIGFzIFhBUElEb3VibGUsIE9BQVBJQ2xpZW50LCBCQUFQSUNsaWVudCB9IGZyb20gJy4vYXBpL2NsaWVudHMuanMnO1xuZXhwb3J0IEFQU1Rva2VuIGZyb20gJy4vYXBzL3Rva2VuLmpzJztcbmV4cG9ydCBBUFNTZXNzaW9uIGZyb20gJy4vYXBzL3Nlc3Npb24uanMnO1xuZXhwb3J0IEhvc3QgZnJvbSAnLi9ob3N0L2hvc3QuanMnO1xuZXhwb3J0IEVuZHBvaW50SG9zdCBmcm9tICcuL2hvc3QvZW5kcG9pbnQtaG9zdC5qcyc7XG5leHBvcnQgU2Vzc2lvbiBmcm9tICcuL2NwL3Nlc3Npb24uanMnO1xuZXhwb3J0IFNTSFNlc3Npb24gZnJvbSAnLi9ob3N0L3NzaC1zZXNzaW9uLmpzJztcblxuZXhwb3J0IHsgZGVmYXVsdCB9IGZyb20gJy4vb3NhL2N0bC5qcyc7XG4iXX0= |
@@ -56,4 +56,4 @@ 'use strict'; | ||
addVersion(version, disabled) { | ||
if (!_util2.default.isNonEmptyString(version)) { | ||
throw new Error('\'version\' must be a non-empty string'); | ||
if (!_util2.default.isAPSApplicationVersion(version)) { | ||
throw new Error('\'version\' must be a valid APS application version'); | ||
} | ||
@@ -75,3 +75,3 @@ | ||
createInstance(url, version, settings) { | ||
if (!_util2.default.isValidFQURL(url)) { | ||
if (!_util2.default.isFQURL(url)) { | ||
throw new Error('\'uri\' must be a valid fully qualified URL'); | ||
@@ -103,11 +103,11 @@ } | ||
return result.then(response => { | ||
if (response.status === 0) { | ||
const instance = ApplicationInstance.fromAPIResponse(this.osa, this, response, version); | ||
if (response.status !== 0) { | ||
throw OAAPIClient.enrichError(new Error(`OSA returned an error: ${response.error_message}`), response); | ||
} | ||
this._instances[instance.id] = instance; | ||
const instance = ApplicationInstance.fromAPIResponse(this.osa, this, response, version); | ||
return instance; | ||
} else { | ||
throw OAAPIClient.enrichError(new Error(`OSA returned an error: ${response.error_message}`), response); | ||
} | ||
this._instances[instance.id] = instance; | ||
return instance; | ||
}); | ||
@@ -130,6 +130,5 @@ } | ||
static fromAPIResponse(osa, application, apiResponse, version) { | ||
const id = apiResponse.result.application_instance_id, | ||
apsID = apiResponse.result.application_resource_id; | ||
const { application_instance_id: id, application_resource_id: apsID } = apiResponse.result; | ||
return new this(osa, application, id, version, apsID);; | ||
return new this(osa, application, id, version, apsID); | ||
} | ||
@@ -144,2 +143,14 @@ | ||
if (!_util2.default.isID(id)) { | ||
throw new Error('\'id\' must be a valid object ID'); | ||
} | ||
if (!_util2.default.isAPSApplicationVersion(version)) { | ||
throw new Error('\'version\' must be a valid APS application version'); | ||
} | ||
if (!_util2.default.isAPSID(apsID)) { | ||
throw new Error('\'apsID\' must be a valid APS ID'); | ||
} | ||
this._application = application; | ||
@@ -159,2 +170,2 @@ this._id = id; | ||
exports.default = Application; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvb3NhL2FwcGxpY2F0aW9uLmpzIl0sIm5hbWVzIjpbIkFwcGxpY2F0aW9uIiwiZnJvbUFQSVJlc3BvbnNlIiwib3NhIiwiYXBpUmVzcG9uc2UiLCJkaXNhYmxlZCIsImFwcGxpY2F0aW9uX2lkIiwiaWQiLCJwYWNrYWdlX3ZlcnNpb24iLCJ2ZXJzaW9uIiwicmVzdWx0IiwiY29uc3RydWN0b3IiLCJfdmVyc2lvbnMiLCJfaW5zdGFuY2VzIiwiaXNJRCIsIkVycm9yIiwiX2lkIiwiYWRkVmVyc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B9XG5cbiAgICBpZiAoIXV0aWwuaXNJRChpZCkpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcignXFwnaWRcXCcgbXVzdCBiZSBhIHZhbGlkIG9iamVjdCBJRCcpO1xuICAgIH1cblxuICAgIGlmICghdXRpbC5pc0FQU0FwcGxpY2F0aW9uVmVyc2lvbih2ZXJzaW9uKSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdcXCd2ZXJzaW9uXFwnIG11c3QgYmUgYSB2YWxpZCBBUFMgYXBwbGljYXRpb24gdmVyc2lvbicpO1xuICAgIH1cblxuICAgIGlmICghdXRpbC5pc0FQU0lEKGFwc0lEKSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdcXCdhcHNJRFxcJyBtdXN0IGJlIGEgdmFsaWQgQVBTIElEJyk7XG4gICAgfVxuXG4gICAgdGhpcy5fYXBwbGljYXRpb24gPSBhcHBsaWNhdGlvbjtcbiAgICB0aGlzLl9pZCA9IGlkO1xuICAgIHRoaXMuX3ZlcnNpb24gPSB2ZXJzaW9uO1xuICAgIHRoaXMuX2Fwc0lEID0gYXBzSUQ7XG4gIH1cblxuICB1bmluc3RhbGwoKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdOb3QgaW1wbGVtZW50ZWQnKTtcbiAgfVxufVxuXG5leHBvcnQgeyBBcHBsaWNhdGlvbiwgQXBwbGljYXRpb25JbnN0YW5jZSB9XG5leHBvcnQgZGVmYXVsdCBBcHBsaWNhdGlvbjtcbiJdfQ== |
@@ -76,8 +76,7 @@ 'use strict'; | ||
this._version = DEFAULTS.VERSION; | ||
this._builder = new _seleniumWebdriver2.default.Builder().forBrowser(DEFAULTS.BROWSER).usingServer(DEFAULTS.HUB_URL); | ||
this._cpURLs = new Map(); | ||
this._apscURL = null; | ||
this._entities = new Map(); | ||
this._builder = new _seleniumWebdriver2.default.Builder().forBrowser(DEFAULTS.BROWSER).usingServer(DEFAULTS.HUB_URL); | ||
this.oaAPI = new Proxy(function (name, parameters) { | ||
this._checkThrowOAAPI(); | ||
this._assertOAAPI(); | ||
@@ -93,3 +92,4 @@ return this._oaAPI.call(name, parameters); | ||
this._parent._checkThrowOAAPI(); | ||
this._parent._assertOAAPI(); | ||
return Reflect.get(this._parent._oaAPI, key); | ||
@@ -99,2 +99,4 @@ }, | ||
set(target, property, value) { | ||
this._parent._assertOAAPI(); | ||
return Reflect.set(this._parent._oaAPI, property, value); | ||
@@ -104,3 +106,3 @@ } | ||
this.baAPI = new Proxy(function (name, parameters) { | ||
this._checkThrowBAAPI(); | ||
this._assertBAAPI(); | ||
@@ -116,3 +118,4 @@ return this._baAPI.call(name, parameters); | ||
this._parent._checkThrowBAAPI(); | ||
this._parent._assertBAAPI(); | ||
return Reflect.get(this._parent._baAPI, key); | ||
@@ -122,2 +125,4 @@ }, | ||
set(target, property, value) { | ||
this._parent._assertBAAPI(); | ||
return Reflect.set(this._parent._baAPI, property, value); | ||
@@ -152,12 +157,67 @@ } | ||
_addEntity(type, key, entity) { | ||
let entities = this._entities.get(type); | ||
if (_util2.default.isUndefined(entities)) { | ||
entities = new Map(); | ||
this._entities.set(type, entities); | ||
} | ||
entities.set(key, entity); | ||
} | ||
_getEntity(type, key) { | ||
const entities = this._entities.get(type); | ||
if (_util2.default.isUndefined(entities)) { | ||
return undefined; | ||
} | ||
return entities.get(key); | ||
} | ||
_removeEntity(type, key) { | ||
const entities = this._entities.get(type); | ||
if (_util2.default.isUndefined(entities)) { | ||
return false; | ||
} | ||
return entities.delete(key); | ||
} | ||
addHost(config, name) { | ||
const host = new _host2.default(config); | ||
this._addEntity(_host2.default, name, host); | ||
return host; | ||
} | ||
addEndpointHost(config, name) { | ||
const host = new _endpointHost2.default(config); | ||
this._addEntity(_endpointHost2.default, name, host); | ||
return host; | ||
} | ||
getHost(name) { | ||
return this._getEntity(_host2.default, name); | ||
} | ||
getEndpointHost(name) { | ||
return this._getEntity(_endpointHost2.default, name); | ||
} | ||
addCPURL(url, name) { | ||
if (!_util2.default.isValidFQURL(url)) { | ||
if (!_util2.default.isFQURL(url)) { | ||
throw new Error('\'url\' must be a valid fully qualified URL'); | ||
} | ||
return this._cpURLs.set(name, url); | ||
return this._addEntity(this.constructor._ENTITY_TYPES.CP_URL, name, url); | ||
} | ||
getCPURL(name) { | ||
return this._cpURLs.get(name); | ||
return this._getEntity(this.constructor._ENTITY_TYPES.CP_URL, name); | ||
} | ||
@@ -170,3 +230,3 @@ | ||
set apscURL(url) { | ||
if (!_util2.default.isValidFQURL(url)) { | ||
if (!_util2.default.isFQURL(url)) { | ||
throw new Error('\'url\' must be a valid fully qualified URL'); | ||
@@ -178,3 +238,3 @@ } | ||
_updateAPSCURLOnce(url) { | ||
_updateApscURLOnce(url) { | ||
if (_util2.default.isNull(this.apscURL)) { | ||
@@ -188,3 +248,3 @@ this.apscURL = url; | ||
tokenPromise.then(({ controllerURL }) => this._updateAPSCURLOnce(controllerURL)); | ||
tokenPromise.then(({ controllerURL }) => this._updateApscURLOnce(controllerURL)); | ||
@@ -198,3 +258,3 @@ return tokenPromise; | ||
if (_util2.default.isValidFQURL(cpURLName)) { | ||
if (_util2.default.isFQURL(cpURLName)) { | ||
url = cpURLName; | ||
@@ -215,3 +275,3 @@ } else { | ||
return authorization.update().then(token => { | ||
this._updateAPSCURLOnce(token.controllerURL); | ||
this._updateApscURLOnce(token.controllerURL); | ||
@@ -224,3 +284,3 @@ return new _session2.default(token.controllerURL, token); | ||
} else { | ||
this._updateAPSCURLOnce(authorization.controllerURL); | ||
this._updateApscURLOnce(authorization.controllerURL); | ||
url = authorization.controllerURL; | ||
@@ -234,3 +294,3 @@ } | ||
return this.getAPSToken(authorization).then(token => { | ||
this._updateAPSCURLOnce(token.controllerURL); | ||
this._updateApscURLOnce(token.controllerURL); | ||
@@ -264,78 +324,18 @@ return new _session2.default(token.controllerURL, token); | ||
_addEntity(key, entity) { | ||
const constructor = entity.constructor; | ||
let entities = this._entities.get(constructor); | ||
setOAAPI(url, options, credentials) { | ||
this._oaAPI = new _clients.OAAPIClient(url, options, credentials); | ||
if (_util2.default.isUndefined(entities)) { | ||
entities = new Map(); | ||
this._entities.set(constructor, entities); | ||
} | ||
entities.set(key, entity); | ||
return this.oaAPI; | ||
} | ||
_getEntity(constructor, key) { | ||
const entities = this._entities.get(constructor); | ||
if (_util2.default.isUndefined(entities)) { | ||
return undefined; | ||
} | ||
return entities.get(key); | ||
set hasOAAPI(_) { | ||
throw new Error('Availability of OA API cannot be changed directly, use \'#setOAAPI\''); | ||
} | ||
_removeEntity(constructor, key) { | ||
const entities = this._entities.get(constructor); | ||
if (_util2.default.isUndefined(entities)) { | ||
return false; | ||
} | ||
return entities.delete(key); | ||
} | ||
addHost(config, name) { | ||
const host = new _host2.default(config); | ||
this._addEntity(name, host); | ||
return host; | ||
} | ||
addEndpointHost(config, name) { | ||
const host = new _endpointHost2.default(config); | ||
this._addEntity(name, host); | ||
return host; | ||
} | ||
getHost(name) { | ||
return this._getEntity(_host2.default, name); | ||
} | ||
getEndpointHost(name) { | ||
return this._getEntity(_endpointHost2.default, name); | ||
} | ||
setOAAPI(options, credentials) { | ||
if (!_util2.default.isUndefined(credentials) || _util2.default.isObject(options) && !(options instanceof _credentials2.default) || _util2.default.isString(options)) { | ||
this._oaAPI = new _clients.OAAPIClient(options, credentials); | ||
} else { | ||
if (!this.hasOAAPI()) { | ||
throw new Error('No OA API information was added, supply \'options\' before supplying \'credentials\''); | ||
} | ||
this._oaAPI.credentials = options; | ||
} | ||
return this.oaAPI; | ||
} | ||
hasOAAPI() { | ||
get hasOAAPI() { | ||
return this._oaAPI instanceof _clients.OAAPIClient; | ||
} | ||
_checkThrowOAAPI() { | ||
if (!this.hasOAAPI()) { | ||
_assertOAAPI() { | ||
if (!this.hasOAAPI) { | ||
throw new Error('No OA API information was added, use \'#setOAAPI\''); | ||
@@ -345,22 +345,18 @@ } | ||
setBAAPI(options, credentials) { | ||
if (!_util2.default.isUndefined(credentials) || _util2.default.isObject(options) && !(options instanceof _credentials2.default) || _util2.default.isString(options)) { | ||
this._baAPI = new _clients.BAAPIClient(options, credentials); | ||
} else { | ||
if (!this.hasBAAPI()) { | ||
throw new Error('No BA API information was added, supply \'options\' before supplying \'credentials\''); | ||
} | ||
setBAAPI(url, options, credentials) { | ||
this._baAPI = new _clients.BAAPIClient(url, options, credentials); | ||
this._baAPI.credentials = options; | ||
} | ||
return this.baAPI; | ||
} | ||
hasBAAPI() { | ||
set hasBAAPI(_) { | ||
throw new Error('Availability of BA API cannot be changed directly, use \'#setBAAPI\''); | ||
} | ||
get hasBAAPI() { | ||
return this._baAPI instanceof _clients.BAAPIClient; | ||
} | ||
_checkThrowBAAPI() { | ||
if (!this.hasBAAPI()) { | ||
_assertBAAPI() { | ||
if (!this.hasBAAPI) { | ||
throw new Error('No BA API information was added, use \'#setBAAPI\''); | ||
@@ -371,3 +367,3 @@ } | ||
importApplication(source, disable) { | ||
this._checkThrowOAAPI(); | ||
this._assertOAAPI(); | ||
@@ -394,27 +390,27 @@ const parameters = { disable_package: Boolean(disable) }; | ||
if (!_util2.default.isUndefined(readPromise)) { | ||
if (_util2.default.isUndefined(readPromise)) { | ||
result = importAPI(parameters); | ||
} else { | ||
result = readPromise.then(file => parameters.package_body = file, error => { | ||
throw new Error(`Failed to read package file: ${error.message}`); | ||
}).then(() => importAPI(parameters)); | ||
} else { | ||
result = importAPI(parameters); | ||
} | ||
return result.then(response => { | ||
if (response.status === 0) { | ||
const existing = this.getApplication(response.result.application_id); | ||
let application; | ||
if (response.status !== 0) { | ||
throw _clients.OAAPIClient.enrichError(new Error(`OSA returned an error: ${response.error_message}`), response); | ||
} | ||
if (_util2.default.isUndefined(existing)) { | ||
application = _application2.default.fromAPIResponse(this, response, disable); | ||
this._addEntity(application.id, application); | ||
} else { | ||
existing.addVersion(response.result.package_version, disable); | ||
application = existing; | ||
} | ||
const existing = this.getApplication(response.result.application_id); | ||
let application; | ||
return application; | ||
if (_util2.default.isUndefined(existing)) { | ||
application = _application2.default.fromAPIResponse(this, response, disable); | ||
this._addEntity(_application2.default, application.id, application); | ||
} else { | ||
throw _clients.OAAPIClient.enrichError(new Error(`OSA returned an error: ${response.error_message}`), response); | ||
existing.addVersion(response.result.package_version, disable); | ||
application = existing; | ||
} | ||
return application; | ||
}); | ||
@@ -438,15 +434,15 @@ } | ||
addResourceType(resourceClass, name, description, parameters) { | ||
this._checkThrowOAAPI(); | ||
this._assertOAAPI(); | ||
} | ||
createServiceTemplate(parameters) { | ||
this._checkThrowOAAPI(); | ||
this._assertOAAPI(); | ||
} | ||
createCustomer(parameters) { | ||
this._checkThrowOAAPI(); | ||
this._assertOAAPI(); | ||
} | ||
createServicePlan(parameters) { | ||
this._checkThrowOAAPI(); | ||
this._assertOAAPI(); | ||
} | ||
@@ -456,3 +452,6 @@ } | ||
OSACtl.APSTOKEN_TYPES = _token2.default.TYPES; | ||
OSACtl._ENTITY_TYPES = { | ||
CP_URL: Symbol('OSACtl._ENTITY_TYPES.CP_URL') | ||
}; | ||
exports.default = OSACtl; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvb3NhL2N0bC5qcyJdLCJuYW1lcyI6WyJyZWFkRmlsZSIsInByb21pc2lmeSIsInVybFBhcnNlIiwicGFyc2UiLCJERUZBVUxUUyIsIlZFUlNJT04iLCJIVUJfVVJMIiwiQlJPV1NFUiIsIkJyb3dzZXIiLCJGSVJFRk9YIiwiT1NBQ3RsIiwiY29uc3RydWN0b3IiLCJ2ZXJzaW9uIiwiX3ZlcnNpb24iLCJfYnVpbGRlciIsIkJ1aWxkZXIiLCJmb3JCcm93c2VyIiwidXNpbmdTZXJ2ZXIiLCJfY3BVUkxzIiwiTWFwIiwiX2Fwc2NVUkwiLCJfZW50aXRpZXMiLCJvYUFQSSIsIlByb3h5IiwibmFtZSIsInBhcmFtZXRlcnMiLCJfY2hlY2tUaHJvd09BQVBJIiwiX29hQVBJIiwiY2FsbCIsIl9wY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250cm9sbGVyVVJMKTtcblxuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgQVBTU2Vzc2lvbih0b2tlbi5jb250cm9sbGVyVVJMLCB0b2tlbik7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdGYWlsZWQgdG8gZGV0ZXJtaW5lIEFQU0MgYmFzZSBVUkwsIG1ha2Ugc3VyZSBcXCdjcFVSTE5hbWVcXCcgaXMgc3BlY2lmaWVkIGNvcnJlY3RseScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLl91cGRhdGVBUFNDVVJMT25jZShhdXRob3JpemF0aW9uLmNvbnRyb2xsZXJVUkwpO1xuICAgICAgICAgICAgdXJsID0gYXV0aG9yaXphdGlvbi5jb250cm9sbGVyVVJMO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBuZXcgQVBTU2Vzc2lvbih1cmwsIGF1dGhvcml6YXRpb24pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKHV0aWwuaXNVbmRlZmluZWQodXJsKSkge1xuICAgICAgICAgIHJldHVybiB0aGlzLmdldEFQU1Rva2VuKGF1dGhvcml6YXRpb24pLnRoZW4odG9rZW4gPT4ge1xuICAgICAgICAgICAgdGhpcy5fdXBkYXRlQVBTQ1VSTE9uY2UodG9rZW4uY29udHJvbGxlclVSTCk7XG5cbiAgICAgICAgICAgIHJldHVybiBuZXcgQVBTU2Vzc2lvbih0b2tlbi5jb250cm9sbGVyVVJMLCB0b2tlbik7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbmV3IEFQU1Nlc3Npb24odXJsLCBuZXcgQVBTVG9rZW4obnVsbCwgYXV0aG9yaXphdGlvbiwgdGhpcykpO1xuICAgICAgfVxuICAgIH0gZWxzZSBpZiAodXR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wpKTtcblxuICAgIHJldHVybiB0b2tlblByb21pc2U7XG4gIH1cblxuICBnZXRBUFNTZXNzaW9uKGF1dGhvcml6YXRpb24sIGNwVVJMTmFtZSkgeyAvLyBSRVRVUk5TIERJRkZFUkVOVCBUWVBFU1xuICAgIGxldCB1cmxcblxuICAgIGlmICh1dGlsLmlzRlFVUkwoY3BVUkxOYW1lKSkge1xuICAgICAgdXJsID0gY3BVUkxOYW1lO1xuICAgIH0gZWxzZSB7XG4gICAgICB1cmwgPSB0aGlzLmdldENQVVJMKGNwVVJMTmFtZSk7XG5cbiAgICAgIGlmICh1dGlsLmlzVW5kZWZpbmVkKHVybCkgJiYgIXV0aWwuaXNOdWxsKHRoaXMuYXBzY1VSTCkpIHtcbiAgICAgICAgdXJsID0gdGhpcy5hcHNjVVJMO1xuICAgICAgfVxuICAgIH1cblxuICAgIGlmICh1dGlsLmlzT2JqZWN0KGF1dGhvcml6YXRpb24pKSB7XG4gICAgICBpZiAoYXV0aG9yaXphdGlvbiBpbnN0YW5jZW9mIEFQU1Rva2VuKSB7XG4gICAgICAgIGlmICh1dGlsLmlzVW5kZWZpbmVkKHVybCkpIHtcbiAgICAgICAgICBpZiAodXRpbC5pc051bGwoYXV0aG9yaXphdGlvbi5jb250cm9sbGVyVVJMKSkge1xuICAgICAgICAgICAgaWYgKGF1dGhvcml6YXRpb24uaXNVcGRhdGFibGUpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGF1dGhvcml6YXRpb24udXBkYXRlKCkudGhlbih0b2tlbiA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdXBkYXRlQXBzY1VSTE9uY2UodG9rZW4uY29udHJvbGxlclVSTCk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEFQU1Nlc3Npb24odG9rZW4uY29udHJvbGxlclVSTCwgdG9rZW4pO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBF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G9tZXIocGFyYW1ldGVycykge1xuICAgIHRoaXMuX2Fzc2VydE9BQVBJKCk7XG4gIH1cblxuICBjcmVhdGVTZXJ2aWNlUGxhbihwYXJhbWV0ZXJzKSB7XG4gICAgdGhpcy5fYXNzZXJ0T0FBUEkoKTtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBPU0FDdGw7XG4iXX0= |
@@ -16,2 +16,4 @@ 'use strict'; | ||
constructor(username, password) { | ||
this.domain = null; | ||
if (username instanceof this.constructor) { | ||
@@ -27,3 +29,2 @@ this.username = username.username; | ||
this.password = password; | ||
this.domain = null; | ||
} | ||
@@ -77,2 +78,2 @@ | ||
exports.default = Credentials; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvdXRpbC9jcmVkZW50aWFscy5qcyJdLCJuYW1lcyI6WyJDcmVkZW50aWFscyIsImNvbnN0cnVjdG9yIiwidXNlcm5hbWUiLCJwYXNzd29yZCIsImRvbWFpbiIsInN0cmluZyIsImlzTm9uRW1wdHlTdHJpbmciLCJFcnJvciIsIl91c2VybmFtZSIsImlzU3RyaW5nIiwiX3Bhc3N3b3JkIiwiX2RvbWFpbiIsImNsb25lIl0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7Ozs7O0FBRUEsTUFBTUEsV0FBTixDQUFrQjs7QUFFaEJDLGNBQVlDLFFBQVosRUFBc0JDLFFBQXRCLEVBQWdDO0FBQzlCLFFBQUlELG9CQUFvQixLQUFLRCxXQUE3QixFQUEwQztBQUN4QyxXQUFLQyxRQUFMLEdBQWdCQSxTQUFTQSxRQUF6QjtBQUNBLFdBQUtDLFFBQUwsR0FBZ0JELFNBQVNDLFFBQXpCO0FBQ0EsV0FBS0MsTUFBTCxHQUFjRixTQUFTRSxNQUF2Qjs7QUFFQTtBQUNEOztBQUVELFNBQUtGLFFBQUwsR0FBZ0JBLFFBQWhCO0FBQ0EsU0FBS0M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RyaW5nKSkge1xuICAgICAgdGhpcy5fcGFzc3dvcmQgPSBzdHJpbmc7XG4gICAgfSBlbHNlIGlmICghc3RyaW5nKSB7XG4gICAgICB0aGlzLl9wYXNzd29yZCA9IG51bGw7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcignUGFzc3dvcmQgbXVzdCBiZSBhIHN0cmluZyBvciBhIGZhbHN5IHZhbHVlJyk7XG4gICAgfVxuICB9XG5cbiAgZ2V0IHBhc3N3b3JkKCkge1xuICAgIHJldHVybiB0aGlzLl9wYXNzd29yZDtcbiAgfVxuXG4gIHNldCBkb21haW4oc3RyaW5nKSB7XG4gICAgaWYgKHV0aWwuaXNTdHJpbmcoc3RyaW5nKSkge1xuICAgICAgdGhpcy5fZG9tYWluID0gc3RyaW5nO1xuICAgIH0gZWxzZSBpZiAoIXN0cmluZykge1xuICAgICAgdGhpcy5fZG9tYWluID0gbnVsbDtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdEb21haW4gbXVzdCBiZSBhIHN0cmluZyBvciBhIGZhbHN5IHZhbHVlJyk7XG4gICAgfVxuICB9XG5cbiAgZ2V0IGRvbWFpbigpIHtcbiAgICByZXR1cm4gdGhpcy5fZG9tYWluO1xuICB9XG5cbiAgY2xvbmUoKSB7XG4gICAgcmV0dXJuIG5ldyB0aGlzLmNvbnN0cnVjdG9yKHRoaXMpO1xuICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IENyZWRlbnRpYWxzO1xuIl19 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvdXRpbC9jcmVkZW50aWFscy5qcyJdLCJuYW1lcyI6WyJDcmVkZW50aWFscyIsImNvbnN0cnVjdG9yIiwidXNlcm5hbWUiLCJwYXNzd29yZCIsImRvbWFpbiIsInN0cmluZyIsImlzTm9uRW1wdHlTdHJpbmciLCJFcnJvciI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IGZhbHN5IHZhbHVlJyk7XG4gICAgfVxuICB9XG5cbiAgZ2V0IGRvbWFpbigpIHtcbiAgICByZXR1cm4gdGhpcy5fZG9tYWluO1xuICB9XG5cbiAgY2xvbmUoKSB7XG4gICAgcmV0dXJuIG5ldyB0aGlzLmNvbnN0cnVjdG9yKHRoaXMpO1xuICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IENyZWRlbnRpYWxzO1xuIl19 |
@@ -100,2 +100,2 @@ 'use strict'; | ||
exports.default = OSAVersion; // interface akin to that of a semver | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvdXRpbC9vc2F2ZXIuanMiXSwibmFtZXMiOlsiUEFERElORyIsIm1ham9yIiwibWlub3IiLCJidWlsZCIsInVwZGF0ZSIsInVwZGF0ZUJ1aWxkIiwia2IiLCJrYkJ1aWxkIiwiT1NBVmVyc2lvbiIsImlzVmFsaWRWZXJzaW9uIiwic3RyaW5nIiwiQm9vbGVhbiIsIlN0cmluZyIsIm1hdGNoIiwiX3ZlcnNpb25SWCIsImNvbnN0cnVjdG9yIiwidmVyc2lvbiIsImZvckVhY2giLCJrZXkiLCJtYXRjaGVzIiwiRXJyb3IiLCJ0eXBlIiwidmFsdWVPZiIsInJlZHVjZSIsImFjYyIsInBhZCIsInRvU3RyaW5nIiwiY2xvbmUiLCJjb21wYXJlIiwidjEiLCJ2MiIsInZlcnNpb24xIiwidmVyc2lvbjIiLCJyY29tcGFyZSIsImd0IiwibHQiLCJlcSJdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUVBOzs7Ozs7QUFFQSxNQUFNQSxVQUFVLEVBQUU7QUFDaEJDLFNBQU8sQ0FETztBQUVkQyxTQUFPLENBRk87QUFHZEMsU0FBTyxDQUhPO0FBSWRDLFVBQVEsQ0FKTTtBQUtkQyxlQUFhLENBTEM7QUFNZEMsTUFBSSxDQU5VO0FBT2RDLFdBQVM7QU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ICAgIHJldHVybiAtMTtcbiAgfVxufVxuXG5mdW5jdGlvbiByY29tcGFyZSh2MSwgdjIpIHtcbiAgcmV0dXJuIC1jb21wYXJlKHYxLCB2Mik7XG59XG5cbmZ1bmN0aW9uIGd0KHYxLCB2Mikge1xuICByZXR1cm4gbmV3IE9TQVZlcnNpb24odjEpID4gbmV3IE9TQVZlcnNpb24odjIpO1xufVxuXG5mdW5jdGlvbiBsdCh2MSwgdjIpIHtcbiAgcmV0dXJuIG5ldyBPU0FWZXJzaW9uKHYxKSA8IG5ldyBPU0FWZXJzaW9uKHYyKTtcbn1cblxuZnVuY3Rpb24gZXEodjEsIHYyKSB7XG4gIHJldHVybiBuZXcgT1NBVmVyc2lvbih2MSkudmFsdWVPZigpID09PSBuZXcgT1NBVmVyc2lvbih2MikudmFsdWVPZigpO1xufVxuXG5leHBvcnQgeyBcbiAgT1NBVmVyc2lvbixcbiAgY29tcGFyZSxcbiAgcmNvbXBhcmUsXG4gIGd0LFxuICBsdCxcbiAgZXEsXG59O1xuZXhwb3J0IGRlZmF1bHQgT1NBVmVyc2lvbjsgLy8gaW50ZXJmYWNlIGFraW4gdG8gdGhhdCBvZiBhIHNlbXZlclxuIl19 |
@@ -21,4 +21,6 @@ 'use strict'; | ||
const TCP_PORT_MAX = Math.pow(2, 16), | ||
TCP_PORT_MIN = 0; | ||
const PEM_KEY_START = '-----BEGIN RSA PRIVATE KEY-----', | ||
PEM_KEY_END = '-----END RSA PRIVATE KEY-----', | ||
PEM_CERTIFICATE_START = '-----BEGIN CERTIFICATE-----', | ||
PEM_CERTIFICATE_END = '-----END CERTIFICATE-----'; | ||
@@ -35,12 +37,19 @@ const util = Object.assign({}, _util2.default, _coreUtilIs2.default, { | ||
isAPSID(string) { | ||
return util.isString(string) && /[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}/.test(string); | ||
}, | ||
isAPSApplicationVersion(string) { | ||
return util.isString(string); | ||
}, | ||
isTCPPort(number) { | ||
const TCP_PORT_MAX = Math.pow(2, 16), | ||
TCP_PORT_MIN = 0; | ||
return Number.isSafeInteger(number) && number > TCP_PORT_MIN && number < TCP_PORT_MAX; | ||
}, | ||
isValidFQURL(string) { | ||
if (!util.isString(string)) { | ||
return false; | ||
} | ||
return Boolean(_url2.default.parse(string).hostname); | ||
isFQURL(string) { | ||
return util.isString(string) && Boolean(_url2.default.parse(string).hostname); | ||
}, | ||
@@ -50,9 +59,9 @@ | ||
if (!util.isString(string)) { | ||
throw new Error('\'string\' must be a string'); | ||
return false; | ||
} | ||
const notBase64 = /[^A-Z0-9+\/=]/i, | ||
const NOT_BASE64 = /[^A-Z0-9+\/=]/i, | ||
length = string.length; | ||
if (!length || length % 4 !== 0 || notBase64.test(string)) { | ||
if (!length || length % 4 !== 0 || NOT_BASE64.test(string)) { | ||
return false; | ||
@@ -66,3 +75,72 @@ } | ||
isPEMCertificate(string) { | ||
if (!util.isString(string)) { | ||
return false; | ||
} | ||
if (!string.startsWith(PEM_CERTIFICATE_START)) { | ||
return false; | ||
} | ||
string = string.slice(PEM_CERTIFICATE_START.length); | ||
if (string.endsWith('\\n')) { | ||
string = string.slice(0, -1); | ||
} | ||
if (!string.endsWith(PEM_CERTIFICATE_END)) { | ||
return false; | ||
} | ||
string = string.slice(0, -PEM_CERTIFICATE_END.length); | ||
return util.isBase64(string.replace(/\n/g, '')); | ||
}, | ||
isPEMKey(string) { | ||
if (!util.isString(string)) { | ||
return false; | ||
} | ||
if (!string.startsWith(PEM_KEY_START)) { | ||
return false; | ||
} | ||
string = string.slice(PEM_KEY_START.length); | ||
if (string.endsWith('\n')) { | ||
string = string.slice(0, -1); | ||
} | ||
if (!string.endsWith(PEM_KEY_END)) { | ||
return false; | ||
} | ||
string = string.slice(0, -PEM_KEY_END.length); | ||
return util.isBase64(string.replace(/\n/g, '')); | ||
}, | ||
isPEMCertificateAndKey(string) { | ||
// Format accepted by 'curl -E' | ||
if (!util.isString(string)) { | ||
return false; | ||
} | ||
const parts = string.split(`${PEM_CERTIFICATE_END}\n${PEM_KEY_START}`); | ||
if (parts.length !== 2) { | ||
return false; | ||
} | ||
let [certificate, key] = parts; | ||
certificate += PEM_CERTIFICATE_END; | ||
key = PEM_KEY_START + key; | ||
return util.isPEMCertificate(certificate) && util.isPEMKey(key); | ||
}, | ||
isBuffer: Buffer.isBuffer, | ||
isEncoding: Buffer.isEncoding, | ||
@@ -113,2 +191,2 @@ pad(string, char, length) { | ||
exports.default = util; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL19saWIvdXRpbC91dGlsLmpzIl0sIm5hbWVzIjpbIlRDUF9QT1JUX01BWCIsIlRDUF9QT1JUX01JTiIsInV0aWwiLCJPYmplY3QiLCJhc3NpZ24iLCJpc05vbkVtcHR5U3RyaW5nIiwidmFsdWUiLCJpc1N0cmluZyIsImxlbmd0aCIsImlzSUQiLCJudW1iZXIiLCJOdW1iZXIiLCJpc1NhZmVJbnRlZ2VyIiwiaXNUQ1BQb3J0IiwiaXNWYWxpZEZRVVJMIiwic3RyaW5nIiwiQm9vbGVhbiIsInBhcnNlIiwiaG9zdG5hbWUiLCJpc0Jhc2U2NCIsIkVycm9yIiwibm90QmFzZTY0IiwidGVzdCIsImZpcnN0UGFkZGluZ0NoYXIiLCJpbmRleE9mIiwiaXNCdWZmZXIiLCJCdWZmZXIiLCJwYWQiLCJjaGFyIiwiU3RyaW5nIiwicGFyc2VJbnQiLCJoYXZlIiwibmVlZCIsIk1hdGgiLCJhYnMiLCJsZWZ0IiwicmVwZWF0Iiwic2xpY2UiLCJjbGFzc1RvRmFjdG9yeSIsImNvbnN0cnVjdG9yIiwiaXNGdW5jdGlvbiIsImZhY3RvcnkiLCJhcmd1bWVudHMiLCJwcm90b3R5cGUiLCJkZWZpbmVQcm9wZXJ0eSIsImNvbmZpZ3VyYWJsZSIsImVudW1lcmFibGUiLCJ3cml0YWJsZ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nVjdG9yKC4uLmFyZ3VtZW50cyk7IH07XG5cbiAgICBmYWN0b3J5LnByb3RvdHlwZSA9IGNvbnN0cnVjdG9yLnByb3RvdHlwZTtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZmFjdG9yeSwgJ25hbWUnLCB7IGNvbmZpZ3VyYWJsZTogdHJ1ZSwgZW51bWVyYWJsZTogZmFsc2UsIHdyaXRhYmxlOiBmYWxzZSwgdmFsdWU6IGNvbnN0cnVjdG9yLm5hbWUgfSk7XG5cbiAgICByZXR1cm4gZmFjdG9yeTtcbiAgfVxufSk7XG5cbm1vZHVsZS5leHBvcnRzID0gdXRpbDsgLy8gYWxsb3dzIGltcG9ydHMgbGlrZSB7IG5hbWUgfVxuZXhwb3J0IGRlZmF1bHQgdXRpbDtcbiJdfQ== |
{ | ||
"name": "osactl", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Odin Automation control framework", | ||
"main": "./lib/main.js", | ||
"dependencies": { | ||
"bluebird": "^3.4.7", | ||
"bluebird": "^3.5.0", | ||
"core-util-is": "^1.0.2", | ||
"request": "^2.79.0", | ||
"request": "^2.81.0", | ||
"scp2": "^0.5.0", | ||
"selenium-webdriver": "^3.1.0", | ||
"selenium-webdriver": "^3.3.0", | ||
"ssh2": "^0.5.4", | ||
@@ -13,0 +13,0 @@ "xmlrpc": "^1.3.2" |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
224782
27
1773
0
Updatedbluebird@^3.5.0
Updatedrequest@^2.81.0
Updatedselenium-webdriver@^3.3.0