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

meadow

Package Overview
Dependencies
Maintainers
3
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meadow - npm Package Compare versions

Comparing version 1.0.29 to 1.0.30

0001-Allow-consumers-to-customize-the-role-index-to-name-.patch

12

package.json
{
"name": "meadow",
"version": "1.0.29",
"version": "1.0.30",
"description": "A data access library.",

@@ -29,15 +29,15 @@ "main": "source/Meadow.js",

"devDependencies": {
"alasql": "^0.4.0",
"chai": "3.5.0",
"codeclimate-test-reporter": "0.4.1",
"alasql": "^0.4.0",
"mysql2": "1.2.0",
"coveralls": "2.13.1",
"groc": "^0.8.0",
"istanbul": "0.4.5",
"mocha": "3.4.1"
"mocha": "3.4.1",
"mysql2": "1.2.0"
},
"dependencies": {
"async": "2.4.0",
"fable": "~1.0.1",
"foxhound": "~1.0.22",
"fable": "^2.0.1",
"foxhound": "~1.0.31",
"is-my-json-valid": "2.16.0",

@@ -44,0 +44,0 @@ "underscore": "1.8.3"

@@ -27,3 +27,3 @@ // ##### Part of the **[retold](https://stevenvelozo.github.io/retold/)** system

// If a valid Fable object isn't passed in, return a constructor
if ((typeof(pMeadow) !== 'object') || (!pMeadow.hasOwnProperty('fable')))
if ((typeof(pMeadow) !== 'object') || !('fable' in pMeadow))
{

@@ -30,0 +30,0 @@ return {new: createNew};

@@ -19,3 +19,3 @@ // ##### Part of the **[retold](https://stevenvelozo.github.io/retold/)** system

// If a valid Fable object isn't passed in, return a constructor
if ((typeof(pFable) !== 'object') || (!pFable.hasOwnProperty('fable')))
if ((typeof(pFable) !== 'object') || !('fable' in pFable))
{

@@ -114,4 +114,4 @@ return {new: createNew};

};
/**

@@ -131,3 +131,3 @@ * Set the Provider for Query execution.

{
return setProvider('None');
pProviderName = 'None';
}

@@ -145,3 +145,2 @@

_ProviderName = pProviderName;

@@ -151,3 +150,3 @@ }

{
_Fable.log.error({ProviderModuleFile:tmpProviderModuleFile, InvalidProvider:pProviderName, error:pError}, 'Provider not set - require load problem');
_Fable.log.error('Provider not set - require load problem', {ProviderModuleFile:tmpProviderModuleFile, InvalidProvider:pProviderName, error:pError});
//setProvider('None');

@@ -288,10 +287,19 @@ }

*/
var _RoleNames = [
"Readonly",
"User",
"Manager",
"Director",
"Executive",
"Administrator"
];
let _RoleNames;
if (Array.isArray(_Fable.settings.MeadowRoleNames))
{
_RoleNames = _Fable.settings.MeadowRoleNames;
}
else
{
_RoleNames =
[
'Unauthenticated',
'User',
'Manager',
'Director',
'Executive',
'Administrator',
];
}
var getRoleName = function(pRoleIndex)

@@ -529,4 +537,29 @@ {

_Fable.addServices(tmpNewMeadowObject);
// addServices removed in fable 2.x
if (typeof(_Fable.addServices) === 'function')
{
_Fable.addServices(tmpNewMeadowObject);
}
else
{
// bring over addServices implementation from Fable 1.x for backward compatibility
Object.defineProperty(tmpNewMeadowObject, 'fable',
{
get: function() { return _Fable; },
enumerable: false,
});
Object.defineProperty(tmpNewMeadowObject, 'settings',
{
get: function() { return _Fable.settings; },
enumerable: false,
});
Object.defineProperty(tmpNewMeadowObject, 'log',
{
get: function() { return _Fable.log; },
enumerable: false,
});
}
return tmpNewMeadowObject;

@@ -533,0 +566,0 @@ }

@@ -12,3 +12,3 @@ // ##### Part of the **[retold](https://stevenvelozo.github.io/retold/)** system

// If a valid Fable object isn't passed in, return a constructor
if ((typeof(pFable) !== 'object') || (!pFable.hasOwnProperty('fable')))
if ((typeof(pFable) !== 'object') || !('fable' in pFable))
{

@@ -15,0 +15,0 @@ return {new: createNew};

@@ -13,15 +13,3 @@ /**

var libFable = require('fable').new({
LogStreams:
[
{
level: 'fatal',
streamtype:'process.stdout',
},
{
level: 'trace',
path: __dirname+'/../tests.log'
}
]
});
var libFable = require('fable');

@@ -69,2 +57,3 @@ var _TestAnimalJsonSchema = (

{
let _Fable;
setup

@@ -74,2 +63,16 @@ (

{
_Fable = libFable.new(
{
LogStreams:
[
{
level: 'fatal',
streamtype:'process.stdout',
},
{
level: 'trace',
path: __dirname+'/../tests.log'
}
]
});
}

@@ -97,3 +100,3 @@ );

{
var testMeadow = require('../source/Meadow.js').new(libFable);
var testMeadow = require('../source/Meadow.js').new(_Fable);
Expect(testMeadow).to.have.a.property('scope')

@@ -112,3 +115,3 @@ .that.is.a('string'); // Scope is always a string

{
var testMeadow = require('../source/Meadow.js').new(libFable, 'Animal', _TestAnimalJsonSchema);
var testMeadow = require('../source/Meadow.js').new(_Fable, 'Animal', _TestAnimalJsonSchema);
Expect(testMeadow.scope)

@@ -125,3 +128,3 @@ .to.equal('Animal');

{
var testMeadow = require('../source/Meadow.js').new(libFable, 'Animal', _TestAnimalJsonSchema);
var testMeadow = require('../source/Meadow.js').new(_Fable, 'Animal', _TestAnimalJsonSchema);
Expect(testMeadow.getRoleName(0))

@@ -142,3 +145,3 @@ .to.equal('Unauthenticated');

{
var testMeadow = require('../source/Meadow.js').new(libFable)
var testMeadow = require('../source/Meadow.js').new(_Fable)
.setScope('Animal')

@@ -158,3 +161,3 @@ .setSchema(_TestAnimalJsonSchema);

{
var testMeadow = require('../source/Meadow.js').new(libFable, 'Animal', _TestAnimalJsonSchema);
var testMeadow = require('../source/Meadow.js').new(_Fable, 'Animal', _TestAnimalJsonSchema);
var tmpValidationResults = testMeadow.validateObject({id:10, type:'bunny', name:'foofoo', age:3});

@@ -170,6 +173,6 @@ Expect(tmpValidationResults.Valid)

{
var testMeadow = require('../source/Meadow.js').new(libFable, 'Animal', _TestAnimalJsonSchema);
var testMeadow = require('../source/Meadow.js').new(_Fable, 'Animal', _TestAnimalJsonSchema);
// Our zombie needs a name!
var tmpValidationResults = testMeadow.validateObject({id:9, type:'zombie', age:3});
libFable.log.info('Bad Unnamed Zombie Validation Results', tmpValidationResults);
_Fable.log.info('Bad Unnamed Zombie Validation Results', tmpValidationResults);
Expect(tmpValidationResults.Valid)

@@ -184,3 +187,3 @@ .to.equal(false);

{
var testMeadow = require('../source/Meadow.js').new(libFable, 'Animal', _TestAnimalJsonSchema);
var testMeadow = require('../source/Meadow.js').new(_Fable, 'Animal', _TestAnimalJsonSchema);
Expect(testMeadow.providerName)

@@ -195,3 +198,3 @@ .to.equal('None');

{
var testMeadow = require('../source/Meadow.js').new(libFable, 'Animal', _TestAnimalJsonSchema);
var testMeadow = require('../source/Meadow.js').new(_Fable, 'Animal', _TestAnimalJsonSchema);
testMeadow.logSlowQuery(100, testMeadow.query);

@@ -205,3 +208,3 @@ }

{
var testMeadow = require('../source/Meadow.js').new(libFable, 'Animal', _TestAnimalJsonSchema);
var testMeadow = require('../source/Meadow.js').new(_Fable, 'Animal', _TestAnimalJsonSchema);
Expect(testMeadow.providerName)

@@ -222,3 +225,3 @@ .to.equal('None');

{
var testMeadow = require('../source/Meadow.js').new(libFable).loadFromPackage(__dirname+'/Animal.json');
var testMeadow = require('../source/Meadow.js').new(_Fable).loadFromPackage(__dirname+'/Animal.json');
Expect(testMeadow.scope)

@@ -233,3 +236,3 @@ .to.equal('FableTest');

{
var testMeadow = require('../source/Meadow.js').new(libFable).loadFromPackage(__dirname+'/EmptyPackage.json');
var testMeadow = require('../source/Meadow.js').new(_Fable).loadFromPackage(__dirname+'/EmptyPackage.json');
Expect(testMeadow.scope)

@@ -244,3 +247,3 @@ .to.equal('Unknown');

{
var testMeadow = require('../source/Meadow.js').new(libFable).loadFromPackage(__dirname+'/BadAnimal.json');
var testMeadow = require('../source/Meadow.js').new(_Fable).loadFromPackage(__dirname+'/BadAnimal.json');
Expect(testMeadow)

@@ -250,5 +253,37 @@ .to.equal(false);

);
test
(
'Able to override role names',
function()
{
// given
_Fable = libFable.new(
{
MeadowRoleNames: ['Cool', 'Bold', 'Tired'],
LogStreams:
[
{
level: 'fatal',
streamtype:'process.stdout',
},
{
level: 'trace',
path: __dirname+'/../tests.log'
}
]
});
const meadow = require('../source/Meadow.js').new(_Fable);
// when
const roleNames = [0, 1, 2].map(i => meadow.getRoleName(i));
// then
Expect(roleNames).to.deep.equal(_Fable.settings.MeadowRoleNames);
}
);
}
);
}
);
);

@@ -25,4 +25,4 @@ /**

Port: 3306,
User: "root",
Password: "",
User: "admin",
Password: "zKVMD14cPC5N",
Database: "FableTest",

@@ -1120,2 +1120,2 @@ ConnectionPoolLimit: 20

}
);
);

@@ -167,3 +167,3 @@ /**

// Can't really test update with NONE
fDone();

@@ -198,3 +198,3 @@ }

{
libFable.log.info(pError, pRecord)
libFable.log.info(pError, pRecord);
Expect(pQuery.parameters.result.executed).to.equal(true);

@@ -209,2 +209,2 @@ fDone();

}
);
);

Sorry, the diff of this file is not supported yet

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