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

starhs-models

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

starhs-models - npm Package Compare versions

Comparing version 5.2.2 to 6.0.0

55

dist/index.js

@@ -6,34 +6,37 @@ 'use strict';

});
exports.JsonWebTokenType = exports.StatusType = exports.Status = exports.LinkType = exports.Link = exports.ListType = exports.List = exports.ProfileType = exports.Profile = exports.StaRHsStatusType = exports.StaRHsStatus = exports.StaRHType = exports.StaRH = exports.ModelType = exports.Model = undefined;
var _starh = require('./starh');
Object.keys(_starh).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _starh[key];
}
});
});
var _starhsStatus = require('./starhs-status');
Object.keys(_starhsStatus).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _starhsStatus[key];
}
});
});
var _profile = require('./profile');
var _model = require('./model');
var _list = require('./list');
var _link = require('./link');
var _status = require('./status');
var _jsonwebtoken = require('./jsonwebtoken');
exports.Model = _model.Model;
exports.ModelType = _model.ModelType;
exports.StaRH = _starh.StaRH;
exports.StaRHType = _starh.StaRHType;
exports.StaRHsStatus = _starhsStatus.StaRHsStatus;
exports.StaRHsStatusType = _starhsStatus.StaRHsStatusType;
exports.Profile = _profile.Profile;
exports.ProfileType = _profile.ProfileType;
exports.List = _list.List;
exports.ListType = _list.ListType;
exports.Link = _link.Link;
exports.LinkType = _link.LinkType;
exports.Status = _status.Status;
exports.StatusType = _status.StatusType;
exports.JsonWebTokenType = _jsonwebtoken.JsonWebTokenType;
Object.keys(_profile).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _profile[key];
}
});
});

@@ -14,16 +14,8 @@ 'use strict';

var _uri = require('rheactor-value-objects/dist/uri');
var _rheactorValueObjects = require('rheactor-value-objects');
var _uri2 = _interopRequireDefault(_uri);
var _rheactorModels = require('rheactor-models');
var _email = require('rheactor-value-objects/dist/email');
var _email2 = _interopRequireDefault(_email);
var _entity = require('./entity');
var _lodash = require('lodash');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -35,3 +27,3 @@

var $context = new _uri2.default('https://github.com/ResourcefulHumans/staRHs-models#Profile');
var $context = new _rheactorValueObjects.URIValue('https://github.com/ResourcefulHumans/staRHs-models#Profile');

@@ -56,4 +48,4 @@ var Profile = exports.Profile = function (_Entity) {

(0, _tcomb.String)(lastname);
_email2.default.Type(email);
(0, _tcomb.maybe)(_uri2.default.Type)(avatar);
(0, _rheactorValueObjects.EmailValueType)(email);
(0, _tcomb.maybe)(_rheactorValueObjects.URIValueType)(avatar);
_this.email = email;

@@ -110,6 +102,6 @@ _this.firstname = firstname;

return new Profile((0, _lodash.merge)(_get(Profile.__proto__ || Object.getPrototypeOf(Profile), 'fromJSON', this).call(this, data), {
email: new _email2.default(email),
email: new _rheactorValueObjects.EmailValue(email),
firstname: firstname,
lastname: lastname,
avatar: avatar ? new _uri2.default(avatar) : avatar
avatar: avatar ? new _rheactorValueObjects.URIValue(avatar) : avatar
}));

@@ -130,3 +122,3 @@ }

return Profile;
}(_entity.Entity);
}(_rheactorModels.Entity);

@@ -143,3 +135,3 @@ var ProfileJSONType = exports.ProfileJSONType = (0, _tcomb.struct)({

var ProfileType = exports.ProfileType = (0, _tcomb.irreducible)('ProfileType', function (x) {
return x instanceof Profile;
return x instanceof Profile || x && x.constructor && x.constructor.name === Profile.name && '$context' in x && _rheactorValueObjects.URIValue.is(x.$context) && $context.equals(x.$context);
});

@@ -14,12 +14,8 @@ 'use strict';

var _uri = require('rheactor-value-objects/dist/uri');
var _rheactorValueObjects = require('rheactor-value-objects');
var _uri2 = _interopRequireDefault(_uri);
var _rheactorModels = require('rheactor-models');
var _entity = require('./entity');
var _lodash = require('lodash');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -31,3 +27,3 @@

var $context = new _uri2.default('https://github.com/ResourcefulHumans/staRHs-models#StaRH');
var $context = new _rheactorValueObjects.URIValue('https://github.com/ResourcefulHumans/staRHs-models#StaRH');
var PositiveIntegerType = (0, _tcomb.refinement)(_tcomb.Number, function (n) {

@@ -98,7 +94,7 @@ return n > 0 && n % 1 === 0;

name: data.from.name,
avatar: data.from.avatar ? new _uri2.default(data.from.avatar) : undefined
avatar: data.from.avatar ? new _rheactorValueObjects.URIValue(data.from.avatar) : undefined
},
to: {
name: data.to.name,
avatar: data.to.avatar ? new _uri2.default(data.to.avatar) : undefined
avatar: data.to.avatar ? new _rheactorValueObjects.URIValue(data.to.avatar) : undefined
},

@@ -122,3 +118,3 @@ amount: data.amount,

return StaRH;
}(_entity.Entity);
}(_rheactorModels.Entity);

@@ -139,4 +135,4 @@ var PersonJSONType = exports.PersonJSONType = (0, _tcomb.struct)({

var StaRHType = exports.StaRHType = (0, _tcomb.irreducible)('StaRHType', function (x) {
return x instanceof StaRH;
return x instanceof StaRH || x && x.constructor && x.constructor.name === StaRH.name && '$context' in x && _rheactorValueObjects.URIValue.is(x.$context) && $context.equals(x.$context);
});
var PersonType = exports.PersonType = (0, _tcomb.struct)({ name: _tcomb.String, avatar: (0, _tcomb.maybe)(_uri2.default.Type) }, 'PersonType');
var PersonType = exports.PersonType = (0, _tcomb.struct)({ name: _tcomb.String, avatar: (0, _tcomb.maybe)(_rheactorValueObjects.URIValueType) }, 'PersonType');

@@ -14,12 +14,8 @@ 'use strict';

var _uri = require('rheactor-value-objects/dist/uri');
var _rheactorValueObjects = require('rheactor-value-objects');
var _uri2 = _interopRequireDefault(_uri);
var _rheactorModels = require('rheactor-models');
var _model = require('./model');
var _lodash = require('lodash');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -34,3 +30,3 @@

}, 'ZeroOrPositiveIntegerType');
var $context = new _uri2.default('https://github.com/ResourcefulHumans/staRHs-models#StaRHsStatus');
var $context = new _rheactorValueObjects.URIValue('https://github.com/ResourcefulHumans/staRHs-models#StaRHsStatus');

@@ -108,3 +104,3 @@ var StaRHsStatus = exports.StaRHsStatus = function (_Model) {

return StaRHsStatus;
}(_model.Model);
}(_rheactorModels.Model);

@@ -122,3 +118,3 @@ var StaRHsStatusJSONType = exports.StaRHsStatusJSONType = (0, _tcomb.struct)({

var StaRHsStatusType = exports.StaRHsStatusType = (0, _tcomb.irreducible)('StaRHsStatusType', function (x) {
return x instanceof StaRHsStatus;
return x instanceof StaRHsStatus || x && x.constructor && x.constructor.name === StaRHsStatus.name && '$context' in x && _rheactorValueObjects.URIValue.is(x.$context) && $context.equals(x.$context);
});
{
"name": "starhs-models",
"version": "5.2.2",
"version": "6.0.0",
"description": "Shared models for the staRHs API",

@@ -31,3 +31,4 @@ "main": "dist/index.js",

"dependencies": {
"rheactor-value-objects": "^3.6.0",
"rheactor-models": "^2.0.0",
"rheactor-value-objects": "^4.0.0",
"tcomb": "^3.2.15"

@@ -34,0 +35,0 @@ },

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