feat: ✨ Created a mini nodeJS server with NewMan for testing without PostMan GUI.
This will mimic a run in a CD/CI environment or docker container.
This commit is contained in:
99
node_modules/postman-collection/lib/collection/version.js
generated
vendored
Normal file
99
node_modules/postman-collection/lib/collection/version.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
var _ = require('../util').lodash,
|
||||
semver = require('semver'),
|
||||
PropertyBase = require('./property-base').PropertyBase,
|
||||
|
||||
Version;
|
||||
|
||||
/**
|
||||
* @typedef {Object|String} Version.definition
|
||||
*/
|
||||
_.inherit((
|
||||
|
||||
/**
|
||||
* Defines a Version.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {PropertyBase}
|
||||
* @param {Version.definition} definition -
|
||||
*/
|
||||
Version = function PostmanPropertyVersion (definition) {
|
||||
// in case definition object is missing, there is no point moving forward
|
||||
if (!definition) { return; }
|
||||
|
||||
// call the setter to process the version string and assign it to this object
|
||||
this.set(definition);
|
||||
}), PropertyBase);
|
||||
|
||||
_.assign(Version.prototype, /** @lends Version.prototype */ {
|
||||
/**
|
||||
* Set the version value as string or object with separate components of version
|
||||
*
|
||||
* @draft
|
||||
* @param {object|string} value -
|
||||
*/
|
||||
set (value) {
|
||||
// extract the version logic and in case it failes and value passed is an object, we use that assuming parsed
|
||||
// value has been sent.
|
||||
var ver = semver.parse(value) || value || {};
|
||||
|
||||
_.assign(this, /** @lends Version.prototype */ {
|
||||
/**
|
||||
* The raw URL string. If {@link Version#set} is called with a string parameter, the string is saved here
|
||||
* before parsing various Version components.
|
||||
*
|
||||
* @type {String}
|
||||
*/
|
||||
raw: ver.raw,
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
major: ver.major,
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
minor: ver.minor,
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
patch: ver.patch,
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
prerelease: ver.prerelease && ver.prerelease.join && ver.prerelease.join() || ver.prerelease,
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
build: ver.build && ver.build.join && ver.build.join() || ver.build,
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
string: ver.version
|
||||
});
|
||||
},
|
||||
|
||||
toString () {
|
||||
// TODO: is this enough? should we build the semver back up?
|
||||
return this.string || this.raw;
|
||||
}
|
||||
});
|
||||
|
||||
_.assign(Version, /** @lends Version */ {
|
||||
/**
|
||||
* Defines the name of this property for internal use.
|
||||
*
|
||||
* @private
|
||||
* @readOnly
|
||||
* @type {String}
|
||||
*/
|
||||
_postman_propertyName: 'Version'
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
Version
|
||||
};
|
Reference in New Issue
Block a user