Skip to content

Instantly share code, notes, and snippets.

@WoodyWoodsta WoodyWoodsta/.babel.json

Last active Sep 27, 2016
Embed
What would you like to do?
Elementary OS setup stuff
{
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/index.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [
"interopRequireWildcard"
],
"marked": [],
"modules": {
"imports": [
{
"source": "chai",
"imported": [
"expect"
],
"specifiers": [
{
"kind": "named",
"imported": "expect",
"local": "expect"
}
]
},
{
"source": "mocha",
"imported": [
"describe",
"it"
],
"specifiers": [
{
"kind": "named",
"imported": "describe",
"local": "describe"
},
{
"kind": "named",
"imported": "it",
"local": "it"
}
]
},
{
"source": "..",
"imported": [
"*"
],
"specifiers": [
{
"kind": "namespace",
"local": "vEngine"
}
]
}
],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/index.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/index.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "index.es6",
"sourceFileName": "index.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "index"
},
"ignored": false,
"code": "'use strict';\n\nvar _chai = require('chai');\n\nvar _mocha = require('mocha');\n\nvar _ = require('..');\n\nvar vEngine = babelHelpers.interopRequireWildcard(_);\n\n\n(0, _mocha.describe)('vEngine API', () => {\n (0, _mocha.it)('should expose the validators', () => {\n (0, _chai.expect)(vEngine.invoiceProcessValidator).to.exist;\n });\n}); /* eslint max-len:0 */\n/* eslint no-unused-expressions:0 */\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmVzNiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBOztBQUNBOztBQUVBOztJQUFZLE87OztBQUVaLHFCQUFTLGFBQVQsRUFBd0IsTUFBTTtBQUM1QixpQkFBRyw4QkFBSCxFQUFtQyxNQUFNO0FBQ3ZDLHNCQUFPLFFBQVEsdUJBQWYsRUFBd0MsRUFBeEMsQ0FBMkMsS0FBM0M7QUFDRCxHQUZEO0FBR0QsQ0FKRCxFIiwiZmlsZSI6ImluZGV4LmVzNiIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludCBtYXgtbGVuOjAgKi9cbi8qIGVzbGludCBuby11bnVzZWQtZXhwcmVzc2lvbnM6MCAqL1xuaW1wb3J0IHsgZXhwZWN0IH0gZnJvbSAnY2hhaSc7XG5pbXBvcnQgeyBkZXNjcmliZSwgaXQgfSBmcm9tICdtb2NoYSc7XG5cbmltcG9ydCAqIGFzIHZFbmdpbmUgZnJvbSAnLi4nO1xuXG5kZXNjcmliZSgndkVuZ2luZSBBUEknLCAoKSA9PiB7XG4gIGl0KCdzaG91bGQgZXhwb3NlIHRoZSB2YWxpZGF0b3JzJywgKCkgPT4ge1xuICAgIGV4cGVjdCh2RW5naW5lLmludm9pY2VQcm9jZXNzVmFsaWRhdG9yKS50by5leGlzdDtcbiAgfSk7XG59KTtcbiJdfQ==",
"ast": null,
"map": {
"version": 3,
"sources": [
"index.es6"
],
"names": [],
"mappings": ";;AAEA;;AACA;;AAEA;;IAAY,O;;;AAEZ,qBAAS,aAAT,EAAwB,MAAM;AAC5B,iBAAG,8BAAH,EAAmC,MAAM;AACvC,sBAAO,QAAQ,uBAAf,EAAwC,EAAxC,CAA2C,KAA3C;AACD,GAFD;AAGD,CAJD,E",
"file": "index.es6",
"sourcesContent": [
"/* eslint max-len:0 */\n/* eslint no-unused-expressions:0 */\nimport { expect } from 'chai';\nimport { describe, it } from 'mocha';\n\nimport * as vEngine from '..';\n\ndescribe('vEngine API', () => {\n it('should expose the validators', () => {\n expect(vEngine.invoiceProcessValidator).to.exist;\n });\n});\n"
]
},
"mtime": 1467102978616
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/index.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [
"interopRequireDefault",
"interopRequireWildcard"
],
"marked": [],
"modules": {
"imports": [
{
"source": "debug",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "debug"
}
]
},
{
"source": "nools",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "nools"
}
]
}
],
"exports": {
"exported": [
"invoiceProcessValidator"
],
"specifiers": [
{
"kind": "external-namespace",
"exported": "invoiceProcessValidator",
"source": "./validators/invoice-process-test-validator"
}
]
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/index.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/index.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "index.es6",
"sourceFileName": "index.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "index"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.invoiceProcessValidator = undefined;\n\nvar _debug = require('debug');\n\nvar _debug2 = babelHelpers.interopRequireDefault(_debug);\n\nvar _nools = require('nools');\n\nvar _nools2 = babelHelpers.interopRequireDefault(_nools);\n\nvar _invoiceProcessTestValidator = require('./validators/invoice-process-test-validator');\n\nvar _invoiceProcessValidator = babelHelpers.interopRequireWildcard(_invoiceProcessTestValidator);\n\nexports.invoiceProcessValidator = _invoiceProcessValidator; /* index.es6 */\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmVzNiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQ0E7Ozs7QUFDQTs7Ozs7Ozs7UUFFWSx1QiIsImZpbGUiOiJpbmRleC5lczYiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBpbmRleC5lczYgKi9cbmltcG9ydCBkZWJ1ZyBmcm9tICdkZWJ1Zyc7XG5pbXBvcnQgbm9vbHMgZnJvbSAnbm9vbHMnO1xuXG5leHBvcnQgKiBhcyBpbnZvaWNlUHJvY2Vzc1ZhbGlkYXRvciBmcm9tICcuL3ZhbGlkYXRvcnMvaW52b2ljZS1wcm9jZXNzLXRlc3QtdmFsaWRhdG9yJztcbiJdfQ==",
"ast": null,
"map": {
"version": 3,
"sources": [
"index.es6"
],
"names": [],
"mappings": ";;;;;;;AACA;;;;AACA;;;;;;;;QAEY,uB",
"file": "index.es6",
"sourcesContent": [
"/* index.es6 */\nimport debug from 'debug';\nimport nools from 'nools';\n\nexport * as invoiceProcessValidator from './validators/invoice-process-test-validator';\n"
]
},
"mtime": 1467107162806
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/simple-workitem-model.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [
"interopRequireDefault"
],
"marked": [],
"modules": {
"imports": [
{
"source": "./compiled",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "foo"
}
]
}
],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/simple-workitem-model.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/simple-workitem-model.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "simple-workitem-model.es6",
"sourceFileName": "simple-workitem-model.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "simple-workitem-model"
},
"ignored": false,
"code": "'use strict';\n\nvar _compiled = require('./compiled');\n\nvar _compiled2 = babelHelpers.interopRequireDefault(_compiled);\n\n// import { ValidationEngine } from '..';\n\nconsole.log(_compiled2.default); /* simple-workitem-model.es6 */\n// Typical Validation Demonstration\n// import nools from 'nools';\n\nconst flow = (0, _compiled2.default)();\nconst session = flow.getSession();\n\nconsole.log(session);\n\n// const engine = new ValidationEngine('rules.nools');\n//\n// const workitemModel1 = new engine.models.WorkitemModel({\n// invoiceNumber: 13258253,\n// invoiceDate: '2016-06-10',\n// // invoiceDate: new Date('2016-06-10'),\n// basNumber: '012345678',\n// }, {\n// 'workitem.invoiceNumber': new engine.outcomes.ValidationOutcome(),\n// 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n// 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n// });\n//\n// const start = Date.now();\n// engine.validate([workitemModel1])\n// .then(() => {\n// console.log('\\nValidation Complete!\\n');\n// console.log('Time Elasped:', Date.now() - start, '\\n');\n// console.log('Outcomes:\\n');\n// console.log(workitemModel1.validation);\n// });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNpbXBsZS13b3JraXRlbS1tb2RlbC5lczYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFHQTs7Ozs7O0FBR0EsUUFBUSxHQUFSLHFCOzs7O0FBQ0EsTUFBTSxPQUFPLHlCQUFiO0FBQ0EsTUFBTSxVQUFVLEtBQUssVUFBTCxFQUFoQjs7QUFFQSxRQUFRLEdBQVIsQ0FBWSxPQUFaIiwiZmlsZSI6InNpbXBsZS13b3JraXRlbS1tb2RlbC5lczYiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBzaW1wbGUtd29ya2l0ZW0tbW9kZWwuZXM2ICovXG4vLyBUeXBpY2FsIFZhbGlkYXRpb24gRGVtb25zdHJhdGlvblxuLy8gaW1wb3J0IG5vb2xzIGZyb20gJ25vb2xzJztcbmltcG9ydCBmb28gZnJvbSAnLi9jb21waWxlZCc7XG4vLyBpbXBvcnQgeyBWYWxpZGF0aW9uRW5naW5lIH0gZnJvb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1xcbicpO1xuLy8gICAgIGNvbnNvbGUubG9nKCdPdXRjb21lczpcXG4nKTtcbi8vICAgICBjb25zb2xlLmxvZyh3b3JraXRlbU1vZGVsMS52YWxpZGF0aW9uKTtcbi8vICAgfSk7XG4iXX0=",
"ast": null,
"map": {
"version": 3,
"sources": [
"simple-workitem-model.es6"
],
"names": [],
"mappings": ";;AAGA;;;;;;AAGA,QAAQ,GAAR,qB;;;;AACA,MAAM,OAAO,yBAAb;AACA,MAAM,UAAU,KAAK,UAAL,EAAhB;;AAEA,QAAQ,GAAR,CAAY,OAAZ",
"file": "simple-workitem-model.es6",
"sourcesContent": [
"/* simple-workitem-model.es6 */\n// Typical Validation Demonstration\n// import nools from 'nools';\nimport foo from './compiled';\n// import { ValidationEngine } from '..';\n\nconsole.log(foo);\nconst flow = foo();\nconst session = flow.getSession();\n\nconsole.log(session);\n\n// const engine = new ValidationEngine('rules.nools');\n//\n// const workitemModel1 = new engine.models.WorkitemModel({\n// invoiceNumber: 13258253,\n// invoiceDate: '2016-06-10',\n// // invoiceDate: new Date('2016-06-10'),\n// basNumber: '012345678',\n// }, {\n// 'workitem.invoiceNumber': new engine.outcomes.ValidationOutcome(),\n// 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n// 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n// });\n//\n// const start = Date.now();\n// engine.validate([workitemModel1])\n// .then(() => {\n// console.log('\\nValidation Complete!\\n');\n// console.log('Time Elasped:', Date.now() - start, '\\n');\n// console.log('Outcomes:\\n');\n// console.log(workitemModel1.validation);\n// });\n"
]
},
"mtime": 1466927973556
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/lib/index.js\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/lib/index.js",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/lib/index.js",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "index.js",
"sourceFileName": "index.js",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "index"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ValidationEngine = undefined;\n\nvar _debug = require('debug');\n\nvar _debug2 = babelHelpers.interopRequireDefault(_debug);\n\nvar _nools = require('nools');\n\nvar _nools2 = babelHelpers.interopRequireDefault(_nools);\n\nvar _helpers = require('./helpers');\n\nconst dbg = (0, _debug2.default)('v-engine');\n\n/**\n * ValidationEngine class\n *\n * @param rulesPath: a path to the `nools` DSL rules file to compile and use\n */\n/* index.es6 */\n\nclass ValidationEngine {\n constructor(rulesPath) {\n this.flow = _nools2.default.compile(rulesPath, { scope: { recordOutcome: _helpers.recordOutcome, constraints: _helpers.constraints } });\n this.flowSession = this.flow.getSession();\n\n this.models = {\n WorkitemModel: this.flow.getDefined('WorkitemModel'),\n AppStateModel: this.flow.getDefined('AppStateModel')\n };\n\n this.outcomes = {\n ValidationOutcome: this.flow.getDefined('ValidationOutcome'),\n RuleOutcome: this.flow.getDefined('RuleOutcome')\n };\n }\n\n /**\n * Validate input models using the created engine\n *\n * @param model: an array of the models to be validated\n * @return promise as returned by `session.prototype.match`\n */\n validate(models) {\n // Assert the models as the facts\n models.forEach(model => {\n this.flowSession.assert(model);\n });\n\n // Execute and return the promise\n return this.flowSession.match();\n }\n}\nexports.ValidationEngine = ValidationEngine;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBLE9BQU8sY0FBUCxDQUFzQixPQUF0QixFQUErQixZQUEvQixFQUE2QztBQUMzQyxTQUFPO0FBRG9DLENBQTdDO0FBR0EsUUFBUSxnQkFBUixHQUEyQixTQUEzQjs7QUFFQSxJQUFJLFNBQVMsUUFBUSxPQUFSLENBQWI7O0FBRUEsSUFBSSxVQUFVLGFBQWEscUJBQWIsQ0FBbUMsTUFBbkMsQ0FBZDs7QUFFQSxJQUFJLFNBQVMsUUFBUSxPQUFSLENBQWI7O0FBRUEsSUFBSSxVQUFVLGFBQWEscUJBQWIsQ0FBbUMsTUFBbkMsQ0FBZDs7QUFFQSxJQUFJLFdBQVcsUUFBUSxXQUFSLENBQWY7O0FBRUEsTUFBTSxNQUFNLENBQUMsR0FBRyxRQUFRLE9BQVosRUFBcUIsVUFBckIsQ0FBWjs7Ozs7Ozs7O0FBU0EsTUFBTSxnQkFBTixDQUF1QjtBQUNyQixjQUFZLFNBQVosRUFBdUI7QUFDckIsU0FBSyxJQUFMLEdBQVksUUFBUSxPQUFSLENBQWdCLE9BQWhCLENBQXdCLFNBQXhCLEVBQW1DLEVBQUUsT0FBTyxFQUFFLGVBQWUsU0FBUyxhQUExQixFQUF5QyxhQUFhLFNBQVMsV0FBL0QsRUFBVCxFQUFuQyxDQUFaO0FBQ0EsU0FBSyxXQUFMLEdBQW1CLEtBQUssSUFBTCxDQUFVLFVBQVYsRUFBbkI7O0FBRUEsU0FBSyxNQUFMLEdBQWM7Q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B,CAAwB,SAAxB,EAAmC,EAAE,OAAO,EAAE,eAAe,SAAS,aAA1B,EAAyC,aAAa,SAAS,WAA/D,EAAT,EAAnC,CAAZ;AACA,SAAK,WAAL,GAAmB,KAAK,IAAL,CAAU,UAAV,EAAnB;;AAEA,SAAK,MAAL,GAAc;AACZ,qBAAe,KAAK,IAAL,CAAU,UAAV,CAAqB,eAArB,CADH;AAEZ,qBAAe,KAAK,IAAL,CAAU,UAAV,CAAqB,eAArB;AAFH,KAAd;;AAKA,SAAK,QAAL,GAAgB;AACd,yBAAmB,KAAK,IAAL,CAAU,UAAV,CAAqB,mBAArB,CADL;AAEd,mBAAa,KAAK,IAAL,CAAU,UAAV,CAAqB,aAArB;AAFC,KAAhB;AAID;;;;;;;;AAQD,WAAS,MAAT,EAAiB;;AAEf,WAAO,OAAP,CAAe,SAAS;AACtB,WAAK,WAAL,CAAiB,MAAjB,CAAwB,KAAxB;AACD,KAFD;;;AAKA,WAAO,KAAK,WAAL,CAAiB,KAAjB,EAAP;AACD;AA9BoB;AAgCvB,QAAQ,gBAAR,GAA2B,gBAA3B",
"file": "index.js",
"sourcesContent": [
"'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ValidationEngine = undefined;\n\nvar _debug = require('debug');\n\nvar _debug2 = babelHelpers.interopRequireDefault(_debug);\n\nvar _nools = require('nools');\n\nvar _nools2 = babelHelpers.interopRequireDefault(_nools);\n\nvar _helpers = require('./helpers');\n\nconst dbg = (0, _debug2.default)('v-engine');\n\n/**\n * ValidationEngine class\n *\n * @param rulesPath: a path to the `nools` DSL rules file to compile and use\n */\n/* index.es6 */\n\nclass ValidationEngine {\n constructor(rulesPath) {\n this.flow = _nools2.default.compile(rulesPath, { scope: { recordOutcome: _helpers.recordOutcome, constraints: _helpers.constraints } });\n this.flowSession = this.flow.getSession();\n\n this.models = {\n WorkitemModel: this.flow.getDefined('WorkitemModel'),\n AppStateModel: this.flow.getDefined('AppStateModel')\n };\n\n this.outcomes = {\n ValidationOutcome: this.flow.getDefined('ValidationOutcome'),\n RuleOutcome: this.flow.getDefined('RuleOutcome')\n };\n }\n\n /**\n * Validate input models using the created engine\n *\n * @param model: an array of the models to be validated\n * @return promise as returned by `session.prototype.match`\n */\n validate(models) {\n // Assert the models as the facts\n models.forEach(model => {\n this.flowSession.assert(model);\n });\n\n // Execute and return the promise\n return this.flowSession.match();\n }\n}\nexports.ValidationEngine = ValidationEngine;"
]
},
"mtime": 1466920056174
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/lib/helpers.js\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/lib/helpers.js",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/lib/helpers.js",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "helpers.js",
"sourceFileName": "helpers.js",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "helpers"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.recordOutcome = recordOutcome;\n/* helpers.es6 */\n/**\n * Convenience method to add a rule outcome to the array of outcomes for a partiticular\n * model attribute or validation endpoint. It does so without a re-modify of the validation\n * outcome record if the error/warning has been recorded already.\n * This prevents unrequired re-activiation of the host rule\n *\n * @param ctx: the context of the `then` `nools` DSL environment\n * @param RuleOutcome: the RuleOutcome class definition\n * @param fact: the fact that activated the rule\n * @param path: the path of the validation endpoint in the validation outcome structure\n * @param ruleName: the name string of the rule (the same as the rule name in `nools` DSL)\n * @param validationOutcome: the value to set the endpoint's validation outcome to\n */\nfunction recordOutcome(ctx, RuleOutcome, fact, path, ruleName, ruleOutcome, validationOutcome) {\n if (!fact.validation[path].info[ruleName] || fact.validation[path].info[ruleName].type !== ruleOutcome.type && fact.validation[path].info[ruleName].msg !== ruleOutcome.msg) {\n ctx.modify(fact, function () {\n fact.validation[path].outcome = validationOutcome;\n fact.validation[path].info[ruleName] = ruleOutcome;\n });\n }\n}\n\n/**\n * Custom constraint to check if a string contains a date\n *\n * @param string: string to check\n * @param dateObj: the required date as a Date type\n * @return whether or not `string` includes the required date\n */\nfunction stringIncludesDate(value, dateObj) {\n const fullYear = dateObj.getFullYear();\n const month = dateObj.getMonth() + 1;\n const date = dateObj.getDate();\n\n const dateString = `${ fullYear }${ month >= 10 ? month : `0${ month }` }${ date >= 10 ? date : `0${ date }` }`;\n\n return value && value.includes(dateString);\n}\n\n/**\n * Custom constraint to check if an object has a particular attribute path\n *\n * @param rootObject: the object which is known to exist\n * @param path: string of path off the `rootObject` which is to be tested\n * @return whether or not the path exists\n */\nfunction hasPath(rootObject, path) {\n let obj = rootObject;\n const args = path.split('.');\n\n for (let i = 0; i < args.length; i++) {\n if (!obj || !obj.hasOwnProperty(args[i])) {\n return false;\n }\n obj = obj[args[i]];\n }\n return true;\n}\n\nconst constraints = exports.constraints = {\n stringIncludesDate,\n hasPath\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhlbHBlcnM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llYXIgfSR7IG1vbnRoID49IDEwID8gbW9udGggOiBgMCR7IG1vbnRoIH1gIH0keyBkYXRlID49IDEwID8gZGF0ZSA6IGAwJHsgZGF0ZSB9YCB9YDtcblxuICByZXR1cm4gdmFsdWUgJiYgdmFsdWUuaW5jbHVkZXMoZGF0ZVN0cmluZyk7XG59XG5cbi8qKlxuICogQ3VzdG9tIGNvbnN0cmFpbnQgdG8gY2hlY2sgaWYgYW4gb2JqZWN0IGhhcyBhIHBhcnRpY3VsYXIgYXR0cmlidXRlIHBhdGhcbiAqXG4gKiBAcGFyYW0gcm9vdE9iamVjdDogdGhlIG9iamVjdCB3aGljaCBpcyBrbm93biB0byBleGlzdFxuICogQHBhcmFtIHBhdGg6IHN0cmluZyBvZiBwYXRoIG9mZiB0aGUgYHJvb3RPYmplY3RgIHdoaWNoIGlzIHRvIGJlIHRlc3RlZFxuICogQHJldHVybiB3aGV0aGVyIG9yIG5vdCB0aGUgcGF0aCBleGlzdHNcbiAqL1xuZnVuY3Rpb24gaGFzUGF0aChyb290T2JqZWN0LCBwYXRoKSB7XG4gIGxldCBvYmogPSByb290T2JqZWN0O1xuICBjb25zdCBhcmdzID0gcGF0aC5zcGxpdCgnLicpO1xuXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgYXJncy5sZW5ndGg7IGkrKykge1xuICAgIGlmICghb2JqIHx8ICFvYmouaGFzT3duUHJvcGVydHkoYXJnc1tpXSkpIHtcbiAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG4gICAgb2JqID0gb2JqW2FyZ3NbaV1dO1xuICB9XG4gIHJldHVybiB0cnVlO1xufVxuXG5jb25zdCBjb25zdHJhaW50cyA9IGV4cG9ydHMuY29uc3RyYWludHMgPSB7XG4gIHN0cmluZ0luY2x1ZGVzRGF0ZSxcbiAgaGFzUGF0aFxufTsiXX0=",
"ast": null,
"map": {
"version": 3,
"sources": [
"helpers.js"
],
"names": [],
"mappings": "AAAA;;AAEA,OAAO,cAAP,CAAsB,OAA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CAAb;;AAEA,OAAK,IAAI,IAAI,CAAb,EAAgB,IAAI,KAAK,MAAzB,EAAiC,GAAjC,EAAsC;AACpC,QAAI,CAAC,GAAD,IAAQ,CAAC,IAAI,cAAJ,CAAmB,KAAK,CAAL,CAAnB,CAAb,EAA0C;AACxC,aAAO,KAAP;AACD;AACD,UAAM,IAAI,KAAK,CAAL,CAAJ,CAAN;AACD;AACD,SAAO,IAAP;AACD;;AAED,MAAM,cAAc,QAAQ,WAAR,GAAsB;AACxC,oBADwC;AAExC;AAFwC,CAA1C",
"file": "helpers.js",
"sourcesContent": [
"'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.recordOutcome = recordOutcome;\n/* helpers.es6 */\n/**\n * Convenience method to add a rule outcome to the array of outcomes for a partiticular\n * model attribute or validation endpoint. It does so without a re-modify of the validation\n * outcome record if the error/warning has been recorded already.\n * This prevents unrequired re-activiation of the host rule\n *\n * @param ctx: the context of the `then` `nools` DSL environment\n * @param RuleOutcome: the RuleOutcome class definition\n * @param fact: the fact that activated the rule\n * @param path: the path of the validation endpoint in the validation outcome structure\n * @param ruleName: the name string of the rule (the same as the rule name in `nools` DSL)\n * @param validationOutcome: the value to set the endpoint's validation outcome to\n */\nfunction recordOutcome(ctx, RuleOutcome, fact, path, ruleName, ruleOutcome, validationOutcome) {\n if (!fact.validation[path].info[ruleName] || fact.validation[path].info[ruleName].type !== ruleOutcome.type && fact.validation[path].info[ruleName].msg !== ruleOutcome.msg) {\n ctx.modify(fact, function () {\n fact.validation[path].outcome = validationOutcome;\n fact.validation[path].info[ruleName] = ruleOutcome;\n });\n }\n}\n\n/**\n * Custom constraint to check if a string contains a date\n *\n * @param string: string to check\n * @param dateObj: the required date as a Date type\n * @return whether or not `string` includes the required date\n */\nfunction stringIncludesDate(value, dateObj) {\n const fullYear = dateObj.getFullYear();\n const month = dateObj.getMonth() + 1;\n const date = dateObj.getDate();\n\n const dateString = `${ fullYear }${ month >= 10 ? month : `0${ month }` }${ date >= 10 ? date : `0${ date }` }`;\n\n return value && value.includes(dateString);\n}\n\n/**\n * Custom constraint to check if an object has a particular attribute path\n *\n * @param rootObject: the object which is known to exist\n * @param path: string of path off the `rootObject` which is to be tested\n * @return whether or not the path exists\n */\nfunction hasPath(rootObject, path) {\n let obj = rootObject;\n const args = path.split('.');\n\n for (let i = 0; i < args.length; i++) {\n if (!obj || !obj.hasOwnProperty(args[i])) {\n return false;\n }\n obj = obj[args[i]];\n }\n return true;\n}\n\nconst constraints = exports.constraints = {\n stringIncludesDate,\n hasPath\n};"
]
},
"mtime": 1466920056107
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/two-models.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [
{
"source": "..",
"imported": [
"ValidationEngine"
],
"specifiers": [
{
"kind": "named",
"imported": "ValidationEngine",
"local": "ValidationEngine"
}
]
}
],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/two-models.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/two-models.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "two-models.es6",
"sourceFileName": "two-models.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "two-models"
},
"ignored": false,
"code": "'use strict';\n\nvar _ = require('..');\n\nconst engine = new _.ValidationEngine('rules.nools'); /* simple-workitem-model.es6 */\n// Typical validation example with two models and medium interdependency\n\n\nconst workitemModel = new engine.models.WorkitemModel({\n invoiceDate: new Date('2017-07-10'),\n basNumber: '2016071012'\n}, // basNumber: '',\n{\n 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n workitem: new engine.outcomes.ValidationOutcome(),\n 'custom.workitem.checkout': new engine.outcomes.ValidationOutcome()\n});\n\nconst appStateModel = new engine.models.AppStateModel({\n online: true,\n userType: 'user'\n}, {});\n\nlet start = Date.now();\nengine.validate([workitemModel, appStateModel]).then(() => {\n console.log('\\nValidation Complete!\\n');\n console.log('Time Elasped:', Date.now() - start, '\\n');\n console.log('Outcomes:\\n');\n console.log(workitemModel.validation);\n console.log('\\nFacts:\\n');\n console.log(engine.flowSession.getFacts());\n});\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3by1tb2RlbHMuZXM2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUE7O0FBRUEsTUFBTSxTQUFTLHVCQUFxQixhQUFyQixDQUFmLEM7Ozs7QUFFQSxNQUFNLGdCQUFnQixJQUFJLE9BQU8sTUFBUCxDQUFjLGFBQWxCLENBQWdDO0FBQ3BELGVBQWEsSUFBSSxJQUFKLENBQVMsWUFBVCxDQUR1QztBQUVwRCxhQUFXO0FBRnlDLENBQWhDLEU7QUFJbkI7QUFDRCwwQkFBd0IsSUFBSSxPQUFPLFFBQVAsQ0FBZ0IsaUJBQXBCLEVBRHZCO0FBRUQsd0JBQXNCLElBQUksT0FBTyxRQUFQLENBQWdCLGlCQUFwQixFQUZyQjtBQUdELF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AgY29uc29sZS5sb2coZW5naW5lLmZsb3dTZXNzaW9uLmdldEZhY3RzKCkpO1xuICB9KTtcbiJdfQ==",
"ast": null,
"map": {
"version": 3,
"sources": [
"two-models.es6"
],
"names": [],
"mappings": ";;AAEA;;AAEA,MAAM,SAAS,uBAAqB,aAArB,CAAf,C;;;;AAEA,MAAM,gBAAgB,IAAI,OAAO,MAAP,CAAc,aAAlB,CAAgC;AACpD,eAAa,IAAI,IAAJ,CAAS,YAAT,CADuC;AAEpD,aAAW;AAFyC,CAAhC,E;AAInB;AACD,0BAAwB,IAAI,OAAO,QAAP,CAAgB,iBAApB,EADvB;AAED,wBAAsB,IAAI,OAAO,QAAP,CAAgB,iBAApB,EAFrB;AAGD,YAAU,IAAI,OAAO,QAAP,CAAgB,iBAApB,EAHT;AAID,8BAA4B,IAAI,OAAO,QAAP,CAAgB,iBAApB;AAJ3B,CAJmB,CAAtB;;AAWA,MAAM,gBAAgB,IAAI,OAAO,MAAP,CAAc,aAAlB,CAAgC;AACpD,UAAQ,IAD4C;AAEpD,YAAU;AAF0C,CAAhC,EAGnB,EAHmB,CAAtB;;AAKA,IAAI,QAAQ,KAAK,GAAL,EAAZ;AACA,OAAO,QAAP,CAAgB,CAAC,aAAD,EAAgB,aAAhB,CAAhB,EACG,IADH,CACQ,MAAM;AACV,UAAQ,GAAR,CAAY,0BAAZ;AACA,UAAQ,GAAR,CAAY,eAAZ,EAA6B,KAAK,GAAL,KAAa,KAA1C,EAAiD,IAAjD;AACA,UAAQ,GAAR,CAAY,aAAZ;AACA,UAAQ,GAAR,CAAY,cAAc,UAA1B;AACA,UAAQ,GAAR,CAAY,YAAZ;AACA,UAAQ,GAAR,CAAY,OAAO,WAAP,CAAmB,QAAnB,EAAZ;AACD,CARH",
"file": "two-models.es6",
"sourcesContent": [
"/* simple-workitem-model.es6 */\n// Typical validation example with two models and medium interdependency\nimport { ValidationEngine } from '..';\n\nconst engine = new ValidationEngine('rules.nools');\n\nconst workitemModel = new engine.models.WorkitemModel({\n invoiceDate: new Date('2017-07-10'),\n basNumber: '2016071012',\n // basNumber: '',\n}, {\n 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n workitem: new engine.outcomes.ValidationOutcome(),\n 'custom.workitem.checkout': new engine.outcomes.ValidationOutcome(),\n});\n\nconst appStateModel = new engine.models.AppStateModel({\n online: true,\n userType: 'user',\n}, {});\n\nlet start = Date.now();\nengine.validate([workitemModel, appStateModel])\n .then(() => {\n console.log('\\nValidation Complete!\\n');\n console.log('Time Elasped:', Date.now() - start, '\\n');\n console.log('Outcomes:\\n');\n console.log(workitemModel.validation);\n console.log('\\nFacts:\\n');\n console.log(engine.flowSession.getFacts());\n });\n"
]
},
"mtime": 1466847842796
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/helpers.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [],
"exports": {
"exported": [
"recordOutcome",
"ctx",
"RuleOutcome",
"fact",
"path",
"ruleName",
"ruleOutcome",
"validationOutcome",
"constraints"
],
"specifiers": [
{
"kind": "local",
"local": "recordOutcome",
"exported": "recordOutcome"
},
{
"kind": "local",
"local": "ctx",
"exported": "ctx"
},
{
"kind": "local",
"local": "RuleOutcome",
"exported": "RuleOutcome"
},
{
"kind": "local",
"local": "fact",
"exported": "fact"
},
{
"kind": "local",
"local": "path",
"exported": "path"
},
{
"kind": "local",
"local": "ruleName",
"exported": "ruleName"
},
{
"kind": "local",
"local": "ruleOutcome",
"exported": "ruleOutcome"
},
{
"kind": "local",
"local": "validationOutcome",
"exported": "validationOutcome"
},
{
"kind": "local",
"local": "constraints",
"exported": "constraints"
}
]
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/helpers.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/helpers.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "helpers.es6",
"sourceFileName": "helpers.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "helpers"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.recordOutcome = recordOutcome;\n/* helpers.es6 */\n/**\n * Convenience method to add a rule outcome to the array of outcomes for a partiticular\n * model attribute or validation endpoint. It does so without a re-modify of the validation\n * outcome record if the error/warning has been recorded already.\n * This prevents unrequired re-activiation of the host rule\n *\n * @param ctx: the context of the `then` `nools` DSL environment\n * @param RuleOutcome: the RuleOutcome class definition\n * @param fact: the fact that activated the rule\n * @param path: the path of the validation endpoint in the validation outcome structure\n * @param ruleName: the name string of the rule (the same as the rule name in `nools` DSL)\n * @param validationOutcome: the value to set the endpoint's validation outcome to\n */\nfunction recordOutcome(ctx, RuleOutcome, fact, path, ruleName, ruleOutcome, validationOutcome) {\n if (!fact.validation[path].info[ruleName] || fact.validation[path].info[ruleName].type !== ruleOutcome.type && fact.validation[path].info[ruleName].msg !== ruleOutcome.msg) {\n ctx.modify(fact, function () {\n fact.validation[path].outcome = validationOutcome;\n fact.validation[path].info[ruleName] = ruleOutcome;\n });\n }\n}\n\n/**\n * Custom constraint to check if a string contains a date\n *\n * @param string: string to check\n * @param dateObj: the required date as a Date type\n * @return whether or not `string` includes the required date\n */\nfunction stringIncludesDate(value, dateObj) {\n if (dateObj instanceof Date) {\n const fullYear = dateObj.getFullYear();\n const month = dateObj.getMonth() + 1;\n const date = dateObj.getDate();\n\n const dateString = `${ fullYear }${ month >= 10 ? month : `0${ month }` }${ date >= 10 ? date : `0${ date }` }`;\n\n return value && value.includes(dateString);\n }\n\n return false;\n}\n\n/**\n * Custom constraint to check if an object has a particular attribute path\n *\n * @param rootObject: the object which is known to exist\n * @param path: string of path off the `rootObject` which is to be tested\n * @return whether or not the path exists\n */\nfunction hasPath(rootObject, path) {\n let obj = rootObject;\n const args = path.split('.');\n\n for (let i = 0; i < args.length; i++) {\n if (!obj || !obj.hasOwnProperty(args[i])) {\n return false;\n }\n obj = obj[args[i]];\n }\n return true;\n}\n\nconst constraints = exports.constraints = {\n stringIncludesDate,\n hasPath\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhlbHBlcnMuZXM2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O1FBY2dCLGEsR0FBQSxhOzs7Ozs7Ozs7Ozs7Ozs7QUFBVCxTQUFTLGFBQVQsQ0FBdUIsR0FBdkIsRUFBNEIsV0FBNUIsRUFBeUMsSUFBekMsRUFBK0MsSUFBL0MsRUFBcUQsUUFBckQsRUFBK0QsV0FBL0QsRUFBNEUsaUJBQTVFLEVBQStGO0FBQ3BHLE1BQUksQ0FBQyxLQUFLLFVBQUwsQ0FBZ0IsSUFBaEIsRUFBc0IsSUFBdEIsQ0FBMkIsUUFBM0IsQ0FBRCxJQUNJLEtBQUssVUFBTCxDQUFnQixJQUFoQixFQUFzQixJQUF0QixDQUEyQixRQUEzQixFQUFxQyxJQUFyQyxLQUE4QyxZQUFZLElBQTFELElBQ0QsS0FBSyxVQUFMLENBQWdCLElBQWhCLEVBQXNCLElB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KAA5B,EAAmC,OAAnC,EAA4C;AAC1C,MAAI,mBAAmB,IAAvB,EAA6B;AAC3B,UAAM,WAAW,QAAQ,WAAR,EAAjB;AACA,UAAM,QAAQ,QAAQ,QAAR,KAAqB,CAAnC;AACA,UAAM,OAAO,QAAQ,OAAR,EAAb;;AAEA,UAAM,aAAc,IAAE,QAAS,KAAG,SAAS,EAAV,GAAgB,KAAhB,GAAyB,KAAG,KAAM,GAAE,KAAG,QAAQ,EAAT,GAAe,IAAf,GAAuB,KAAG,IAAK,GAAE,GAAxG;;AAEA,WAAO,SAAS,MAAM,QAAN,CAAe,UAAf,CAAhB;AACD;;AAED,SAAO,KAAP;AACD;;;;;;;;;AASD,SAAS,OAAT,CAAiB,UAAjB,EAA6B,IAA7B,EAAmC;AACjC,MAAI,MAAM,UAAV;AACA,QAAM,OAAO,KAAK,KAAL,CAAW,GAAX,CAAb;;AAEA,OAAK,IAAI,IAAI,CAAb,EAAgB,IAAI,KAAK,MAAzB,EAAiC,GAAjC,EAAsC;AACpC,QAAI,CAAC,GAAD,IAAQ,CAAC,IAAI,cAAJ,CAAmB,KAAK,CAAL,CAAnB,CAAb,EAA0C;AACxC,aAAO,KAAP;AACD;AACD,UAAM,IAAI,KAAK,CAAL,CAAJ,CAAN;AACD;AACD,SAAO,IAAP;AACD;;AAEM,MAAM,oCAAc;AACzB,oBADyB;AAEzB;AAFyB,CAApB",
"file": "helpers.es6",
"sourcesContent": [
"/* helpers.es6 */\n/**\n * Convenience method to add a rule outcome to the array of outcomes for a partiticular\n * model attribute or validation endpoint. It does so without a re-modify of the validation\n * outcome record if the error/warning has been recorded already.\n * This prevents unrequired re-activiation of the host rule\n *\n * @param ctx: the context of the `then` `nools` DSL environment\n * @param RuleOutcome: the RuleOutcome class definition\n * @param fact: the fact that activated the rule\n * @param path: the path of the validation endpoint in the validation outcome structure\n * @param ruleName: the name string of the rule (the same as the rule name in `nools` DSL)\n * @param validationOutcome: the value to set the endpoint's validation outcome to\n */\nexport function recordOutcome(ctx, RuleOutcome, fact, path, ruleName, ruleOutcome, validationOutcome) {\n if (!fact.validation[path].info[ruleName]\n || (fact.validation[path].info[ruleName].type !== ruleOutcome.type\n && fact.validation[path].info[ruleName].msg !== ruleOutcome.msg)) {\n ctx.modify(fact, function() {\n fact.validation[path].outcome = validationOutcome;\n fact.validation[path].info[ruleName] = ruleOutcome;\n });\n }\n}\n\n/**\n * Custom constraint to check if a string contains a date\n *\n * @param string: string to check\n * @param dateObj: the required date as a Date type\n * @return whether or not `string` includes the required date\n */\nfunction stringIncludesDate(value, dateObj) {\n if (dateObj instanceof Date) {\n const fullYear = dateObj.getFullYear();\n const month = dateObj.getMonth() + 1;\n const date = dateObj.getDate();\n\n const dateString = `${fullYear}${(month >= 10) ? month : `0${month}`}${(date >= 10) ? date : `0${date}`}`;\n\n return value && value.includes(dateString);\n }\n\n return false;\n}\n\n/**\n * Custom constraint to check if an object has a particular attribute path\n *\n * @param rootObject: the object which is known to exist\n * @param path: string of path off the `rootObject` which is to be tested\n * @return whether or not the path exists\n */\nfunction hasPath(rootObject, path) {\n let obj = rootObject;\n const args = path.split('.');\n\n for (let i = 0; i < args.length; i++) {\n if (!obj || !obj.hasOwnProperty(args[i])) {\n return false;\n }\n obj = obj[args[i]];\n }\n return true;\n}\n\nexport const constraints = {\n stringIncludesDate,\n hasPath,\n};\n"
]
},
"mtime": 1466924963049
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/helpers.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [
"interopRequireWildcard"
],
"marked": [],
"modules": {
"imports": [
{
"source": "chai",
"imported": [
"expect"
],
"specifiers": [
{
"kind": "named",
"imported": "expect",
"local": "expect"
}
]
},
{
"source": "mocha",
"imported": [
"describe",
"it"
],
"specifiers": [
{
"kind": "named",
"imported": "describe",
"local": "describe"
},
{
"kind": "named",
"imported": "it",
"local": "it"
}
]
},
{
"source": "../helpers",
"imported": [
"*"
],
"specifiers": [
{
"kind": "namespace",
"local": "helpers"
}
]
}
],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/helpers.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/helpers.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "helpers.es6",
"sourceFileName": "helpers.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "helpers"
},
"ignored": false,
"code": "'use strict';\n\nvar _chai = require('chai');\n\nvar _mocha = require('mocha');\n\nvar _helpers = require('../helpers');\n\nvar helpers = babelHelpers.interopRequireWildcard(_helpers);\n\n\n(0, _mocha.describe)('Helpers library', () => {\n (0, _mocha.describe)('#recordOutcome()', () => {\n (0, _mocha.it)('should record a new error for a validation outcome the first time');\n (0, _mocha.it)('should not record the error for a validation outcome if it alread exists');\n });\n\n (0, _mocha.describe)('#constraints.hasPath()', () => {\n const rootObject = {\n foo: 'Hello Foo',\n bar: {\n baz: {\n test: 'Hello Tests!'\n }\n }\n };\n\n (0, _mocha.it)('should return true for a path that exists', () => {\n (0, _chai.expect)(helpers.constraints.hasPath(rootObject, 'bar.baz.test')).to.be.true;\n (0, _chai.expect)(helpers.constraints.hasPath(rootObject, 'foo')).to.be.true;\n });\n\n (0, _mocha.it)('should return flase for a path that does not exist', () => {\n (0, _chai.expect)(helpers.constraints.hasPath(rootObject, 'foo.bar')).to.be.false;\n (0, _chai.expect)(helpers.constraints.hasPath(rootObject, 'bar.test')).to.be.false;\n });\n });\n\n (0, _mocha.describe)('#constraints.stringIncludesDate()', () => {\n const date1 = new Date('2016-10-12');\n const date2 = new Date('2016-09-12');\n const date3 = new Date('2016-10-09');\n\n (0, _mocha.it)('should return true if date (in numbers only) is contained within string', () => {\n (0, _chai.expect)(helpers.constraints.stringIncludesDate('20161012021203123123123903', date1)).to.be.true;\n (0, _chai.expect)(helpers.constraints.stringIncludesDate('20160912021203123123123903', date2)).to.be.true;\n (0, _chai.expect)(helpers.constraints.stringIncludesDate('20161009021203123123123903', date3)).to.be.true;\n });\n\n (0, _mocha.it)('should return false if date is not contained within string', () => {\n (0, _chai.expect)(helpers.constraints.stringIncludesDate('20171012021203123123123903', date1)).to.be.false;\n (0, _chai.expect)(helpers.constraints.stringIncludesDate('20170912021203123123123903', date2)).to.be.false;\n (0, _chai.expect)(helpers.constraints.stringIncludesDate('20171009021203123123123903', date3)).to.be.false;\n });\n });\n}); /* eslint max-len:0 */\n/* eslint no-unused-expressions:0 */\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhlbHBlcnMuZXM2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBR0E7O0FBQ0E7O0FBRUE7O0lBQVksTzs7O0FBRVoscUJBQVMsaUJBQVQsRUFBNEIsTUFBTTtBQUNoQyx1QkFBUyxrQkFBVCxFQUE2QixNQUFNO0FBQ2pDLG1CQUFHLG1FQUFIO0FBQ0EsbUJBQUcsMEVBQUg7QUFDRCxHQUhEOztBQUtBLHVCQUFTLHdCQUFULEVBQW1DLE1BQU07QUFDdkMsVUFBTSxhQUFhO0FBQ2p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esContent": [
"/* eslint max-len:0 */\n/* eslint no-unused-expressions:0 */\n\nimport { expect } from 'chai';\nimport { describe, it } from 'mocha';\n\nimport * as helpers from '../helpers';\n\ndescribe('Helpers library', () => {\n describe('#recordOutcome()', () => {\n it('should record a new error for a validation outcome the first time');\n it('should not record the error for a validation outcome if it alread exists');\n });\n\n describe('#constraints.hasPath()', () => {\n const rootObject = {\n foo: 'Hello Foo',\n bar: {\n baz: {\n test: 'Hello Tests!',\n },\n },\n };\n\n it('should return true for a path that exists', () => {\n expect(helpers.constraints.hasPath(rootObject, 'bar.baz.test')).to.be.true;\n expect(helpers.constraints.hasPath(rootObject, 'foo')).to.be.true;\n });\n\n it('should return flase for a path that does not exist', () => {\n expect(helpers.constraints.hasPath(rootObject, 'foo.bar')).to.be.false;\n expect(helpers.constraints.hasPath(rootObject, 'bar.test')).to.be.false;\n });\n });\n\n describe('#constraints.stringIncludesDate()', () => {\n const date1 = new Date('2016-10-12');\n const date2 = new Date('2016-09-12');\n const date3 = new Date('2016-10-09');\n\n it('should return true if date (in numbers only) is contained within string', () => {\n expect(helpers.constraints.stringIncludesDate('20161012021203123123123903', date1)).to.be.true;\n expect(helpers.constraints.stringIncludesDate('20160912021203123123123903', date2)).to.be.true;\n expect(helpers.constraints.stringIncludesDate('20161009021203123123123903', date3)).to.be.true;\n });\n\n it('should return false if date is not contained within string', () => {\n expect(helpers.constraints.stringIncludesDate('20171012021203123123123903', date1)).to.be.false;\n expect(helpers.constraints.stringIncludesDate('20170912021203123123123903', date2)).to.be.false;\n expect(helpers.constraints.stringIncludesDate('20171009021203123123123903', date3)).to.be.false;\n });\n });\n});\n"
]
},
"mtime": 1467055671957
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/two-models.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [
"interopRequireWildcard"
],
"marked": [],
"modules": {
"imports": [
{
"source": "chai",
"imported": [
"expect"
],
"specifiers": [
{
"kind": "named",
"imported": "expect",
"local": "expect"
}
]
},
{
"source": "mocha",
"imported": [
"describe",
"it"
],
"specifiers": [
{
"kind": "named",
"imported": "describe",
"local": "describe"
},
{
"kind": "named",
"imported": "it",
"local": "it"
}
]
},
{
"source": "..",
"imported": [
"ValidationEngine"
],
"specifiers": [
{
"kind": "named",
"imported": "ValidationEngine",
"local": "ValidationEngine"
}
]
},
{
"source": "../helpers",
"imported": [
"*"
],
"specifiers": [
{
"kind": "namespace",
"local": "helpers"
}
]
}
],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/two-models.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/two-models.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "two-models.es6",
"sourceFileName": "two-models.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "two-models"
},
"ignored": false,
"code": "'use strict';\n\nvar _chai = require('chai');\n\nvar _mocha = require('mocha');\n\nvar _ = require('..');\n\nvar _helpers = require('../helpers');\n\nvar helpers = babelHelpers.interopRequireWildcard(_helpers);\n/* eslint max-len:0 */\n/* eslint no-unused-expressions:0 */\n\nfunction makeFilename(name) {\n return `${ __dirname }/../../examples/${ name }`;\n}\n\nconst engine = new _.ValidationEngine(makeFilename('rules.nools'));\n\n(0, _mocha.describe)('Two models example test', () => {\n (0, _mocha.describe)('All valid', () => {\n const workitemModel = new engine.models.WorkitemModel({\n invoiceDate: new Date('2020-07-10'),\n basNumber: '2020071012'\n }, {\n 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n workitem: new engine.outcomes.ValidationOutcome(),\n 'custom.workitem.checkout': new engine.outcomes.ValidationOutcome()\n });\n\n const appStateModel = new engine.models.AppStateModel({\n online: true,\n userType: 'user'\n }, {});\n\n (0, _mocha.it)('all outcomes should be valid', done => {\n engine.validate([workitemModel, appStateModel]).then(() => {\n (0, _chai.expect)(workitemModel.validation['workitem.invoiceDate'].outcome).to.equal('valid');\n (0, _chai.expect)(workitemModel.validation['workitem.basNumber'].outcome).to.equal('valid');\n (0, _chai.expect)(workitemModel.validation.workitem.outcome).to.equal('valid');\n (0, _chai.expect)(workitemModel.validation['custom.workitem.checkout'].outcome).to.equal('valid');\n\n done();\n }).catch(done);\n });\n\n (0, _mocha.it)('all info objects should be empty', done => {\n engine.validate([workitemModel, appStateModel]).then(() => {\n (0, _chai.expect)(workitemModel.validation['workitem.invoiceDate'].info).to.be.empty;\n (0, _chai.expect)(workitemModel.validation['workitem.basNumber'].info).to.be.empty;\n (0, _chai.expect)(workitemModel.validation.workitem.info).to.be.empty;\n (0, _chai.expect)(workitemModel.validation['custom.workitem.checkout'].info).to.be.empty;\n\n done();\n }).catch(done);\n });\n });\n\n (0, _mocha.describe)('Simple rule invalid, with rule outcome dependence', () => {\n const workitemModel = new engine.models.WorkitemModel({\n invoiceDate: new Date('2020-07-10'),\n basNumber: '2020071112'\n }, {\n 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n workitem: new engine.outcomes.ValidationOutcome(),\n 'custom.workitem.checkout': new engine.outcomes.ValidationOutcome()\n });\n\n const appStateModel = new engine.models.AppStateModel({\n online: true,\n userType: 'user'\n }, {});\n\n (0, _mocha.it)('should report three errors', done => {\n engine.validate([workitemModel, appStateModel]).then(() => {\n (0, _chai.expect)(workitemModel.validation['workitem.invoiceDate'].outcome, '[outcome] - invoiceDate').to.equal('valid');\n (0, _chai.expect)(workitemModel.validation['workitem.basNumber'].outcome, '[outcome] - basNumber').to.equal('invalid');\n (0, _chai.expect)(workitemModel.validation.workitem.outcome, '[outcome] - workitem').to.equal('invalid');\n (0, _chai.expect)(workitemModel.validation['custom.workitem.checkout'].outcome, '[outcome] - custom workitem checkout').to.equal('invalid');\n\n (0, _chai.expect)(workitemModel.validation['workitem.invoiceDate'].info).to.be.empty;\n\n (0, _chai.expect)(workitemModel.validation['workitem.basNumber'].info.basNumberHasInvoiceDate).to.exist;\n (0, _chai.expect)(workitemModel.validation['workitem.basNumber'].info.basNumberHasInvoiceDate.type).to.equal('error');\n\n (0, _chai.expect)(workitemModel.validation.workitem.info.workitemIsValid).to.exist;\n (0, _chai.expect)(workitemModel.validation.workitem.info.workitemIsValid.type).to.equal('error');\n\n (0, _chai.expect)(workitemModel.validation['custom.workitem.checkout'].info.workitemCanCheckout).to.exist;\n (0, _chai.expect)(workitemModel.validation['custom.workitem.checkout'].info.workitemCanCheckout.type).to.equal('error');\n\n done();\n }).catch(done);\n });\n });\n\n (0, _mocha.describe)('Incomplete field, with rule outcome dependence', () => {\n const workitemModel = new engine.models.WorkitemModel({\n invoiceDate: '',\n basNumber: '2020071112'\n }, {\n 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n workitem: new engine.outcomes.ValidationOutcome(),\n 'custom.workitem.checkout': new engine.outcomes.ValidationOutcome()\n });\n\n const appStateModel = new engine.models.AppStateModel({\n online: true,\n userType: 'user'\n }, {});\n\n (0, _mocha.it)('should report incomplete', done => {\n engine.validate([workitemModel, appStateModel]).then(() => {\n (0, _chai.expect)(workitemModel.validation['workitem.invoiceDate'].outcome, '[outcome] - invoiceDate').to.equal('incomplete');\n (0, _chai.expect)(workitemModel.validation['workitem.basNumber'].outcome, '[outcome] - basNumber').to.equal('valid');\n (0, _chai.expect)(workitemModel.validation.workitem.outcome, '[outcome] - workitem').to.equal('incomplete');\n (0, _chai.expect)(workitemModel.validation['custom.workitem.checkout'].outcome, '[outcome] - custom workitem checkout').to.equal('invalid');\n\n (0, _chai.expect)(workitemModel.validation['workitem.invoiceDate'].info.invoiceDateIsComplete).to.exist;\n (0, _chai.expect)(workitemModel.validation['workitem.invoiceDate'].info.invoiceDateIsComplete.type).to.equal('warning');\n\n (0, _chai.expect)(workitemModel.validation['workitem.basNumber'].info).to.be.empty;\n\n (0, _chai.expect)(workitemModel.validation.workitem.info.workitemIsComplete).to.exist;\n (0, _chai.expect)(workitemModel.validation.workitem.info.workitemIsComplete.type).to.equal('warning');\n\n (0, _chai.expect)(workitemModel.validation['custom.workitem.checkout'].info.workitemCanCheckout).to.exist;\n (0, _chai.expect)(workitemModel.validation['custom.workitem.checkout'].info.workitemCanCheckout.type).to.equal('error');\n\n done();\n }).catch(done);\n });\n });\n});\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3by1tb2RlbHMuZXM2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBR0E7O0FBQ0E7O0FBRUE7O0FBQ0E7O0lBQVksTzs7OztBQUVaLFNBQVMsWUFBVCxDQUFzQixJQUF0QixFQUE0QjtBQUMxQixTQUFRLElBQUUsU0FBVSxxQkFBa0IsSUFBSyxHQUEzQztBQUNEOztBQUVELE1BQU0sU0FBUyx1QkFBcUIsYUFBYSxhQUFiLENBQXJCLENBQWY7O0FBRUEscUJBQVMseUJBQVQsRUFBb0MsTUFBTTtBQUN4Qyx1QkFBUyxXQUFULEVBQXNCLE1BQU07QUFDMUI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AAqD,IAArD,CAA0D,mBAAjE,EAAsF,EAAtF,CAAyF,KAAzF;AACA,0BAAO,cAAc,UAAd,CAAyB,0BAAzB,EAAqD,IAArD,CAA0D,mBAA1D,CAA8E,IAArF,EAA2F,EAA3F,CAA8F,KAA9F,CAAoG,OAApG;;AAEA;AACD,OAnBH,EAmBK,KAnBL,CAmBW,IAnBX;AAoBD,KArBD;AAsBD,GAtCD;AAuCD,CAzHD",
"file": "two-models.es6",
"sourcesContent": [
"/* eslint max-len:0 */\n/* eslint no-unused-expressions:0 */\n\nimport { expect } from 'chai';\nimport { describe, it } from 'mocha';\n\nimport { ValidationEngine } from '..';\nimport * as helpers from '../helpers';\n\nfunction makeFilename(name) {\n return `${__dirname}/../../examples/${name}`;\n}\n\nconst engine = new ValidationEngine(makeFilename('rules.nools'));\n\ndescribe('Two models example test', () => {\n describe('All valid', () => {\n const workitemModel = new engine.models.WorkitemModel({\n invoiceDate: new Date('2020-07-10'),\n basNumber: '2020071012',\n }, {\n 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n workitem: new engine.outcomes.ValidationOutcome(),\n 'custom.workitem.checkout': new engine.outcomes.ValidationOutcome(),\n });\n\n const appStateModel = new engine.models.AppStateModel({\n online: true,\n userType: 'user',\n }, {});\n\n it('all outcomes should be valid', (done) => {\n engine.validate([workitemModel, appStateModel])\n .then(() => {\n expect(workitemModel.validation['workitem.invoiceDate'].outcome).to.equal('valid');\n expect(workitemModel.validation['workitem.basNumber'].outcome).to.equal('valid');\n expect(workitemModel.validation.workitem.outcome).to.equal('valid');\n expect(workitemModel.validation['custom.workitem.checkout'].outcome).to.equal('valid');\n\n done();\n }).catch(done);\n });\n\n it('all info objects should be empty', (done) => {\n engine.validate([workitemModel, appStateModel])\n .then(() => {\n expect(workitemModel.validation['workitem.invoiceDate'].info).to.be.empty;\n expect(workitemModel.validation['workitem.basNumber'].info).to.be.empty;\n expect(workitemModel.validation.workitem.info).to.be.empty;\n expect(workitemModel.validation['custom.workitem.checkout'].info).to.be.empty;\n\n done();\n }).catch(done);\n });\n });\n\n describe('Simple rule invalid, with rule outcome dependence', () => {\n const workitemModel = new engine.models.WorkitemModel({\n invoiceDate: new Date('2020-07-10'),\n basNumber: '2020071112',\n }, {\n 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n workitem: new engine.outcomes.ValidationOutcome(),\n 'custom.workitem.checkout': new engine.outcomes.ValidationOutcome(),\n });\n\n const appStateModel = new engine.models.AppStateModel({\n online: true,\n userType: 'user',\n }, {});\n\n it('should report three errors', (done) => {\n engine.validate([workitemModel, appStateModel])\n .then(() => {\n expect(workitemModel.validation['workitem.invoiceDate'].outcome, '[outcome] - invoiceDate').to.equal('valid');\n expect(workitemModel.validation['workitem.basNumber'].outcome, '[outcome] - basNumber').to.equal('invalid');\n expect(workitemModel.validation.workitem.outcome, '[outcome] - workitem').to.equal('invalid');\n expect(workitemModel.validation['custom.workitem.checkout'].outcome, '[outcome] - custom workitem checkout').to.equal('invalid');\n\n expect(workitemModel.validation['workitem.invoiceDate'].info).to.be.empty;\n\n expect(workitemModel.validation['workitem.basNumber'].info.basNumberHasInvoiceDate).to.exist;\n expect(workitemModel.validation['workitem.basNumber'].info.basNumberHasInvoiceDate.type).to.equal('error');\n\n expect(workitemModel.validation.workitem.info.workitemIsValid).to.exist;\n expect(workitemModel.validation.workitem.info.workitemIsValid.type).to.equal('error');\n\n expect(workitemModel.validation['custom.workitem.checkout'].info.workitemCanCheckout).to.exist;\n expect(workitemModel.validation['custom.workitem.checkout'].info.workitemCanCheckout.type).to.equal('error');\n\n done();\n }).catch(done);\n });\n });\n\n describe('Incomplete field, with rule outcome dependence', () => {\n const workitemModel = new engine.models.WorkitemModel({\n invoiceDate: '',\n basNumber: '2020071112',\n }, {\n 'workitem.invoiceDate': new engine.outcomes.ValidationOutcome(),\n 'workitem.basNumber': new engine.outcomes.ValidationOutcome(),\n workitem: new engine.outcomes.ValidationOutcome(),\n 'custom.workitem.checkout': new engine.outcomes.ValidationOutcome(),\n });\n\n const appStateModel = new engine.models.AppStateModel({\n online: true,\n userType: 'user',\n }, {});\n\n it('should report incomplete', (done) => {\n engine.validate([workitemModel, appStateModel])\n .then(() => {\n expect(workitemModel.validation['workitem.invoiceDate'].outcome, '[outcome] - invoiceDate').to.equal('incomplete');\n expect(workitemModel.validation['workitem.basNumber'].outcome, '[outcome] - basNumber').to.equal('valid');\n expect(workitemModel.validation.workitem.outcome, '[outcome] - workitem').to.equal('incomplete');\n expect(workitemModel.validation['custom.workitem.checkout'].outcome, '[outcome] - custom workitem checkout').to.equal('invalid');\n\n expect(workitemModel.validation['workitem.invoiceDate'].info.invoiceDateIsComplete).to.exist;\n expect(workitemModel.validation['workitem.invoiceDate'].info.invoiceDateIsComplete.type).to.equal('warning');\n\n expect(workitemModel.validation['workitem.basNumber'].info).to.be.empty;\n\n expect(workitemModel.validation.workitem.info.workitemIsComplete).to.exist;\n expect(workitemModel.validation.workitem.info.workitemIsComplete.type).to.equal('warning');\n\n expect(workitemModel.validation['custom.workitem.checkout'].info.workitemCanCheckout).to.exist;\n expect(workitemModel.validation['custom.workitem.checkout'].info.workitemCanCheckout.type).to.equal('error');\n\n done();\n }).catch(done);\n });\n });\n});\n"
]
},
"mtime": 1466944354427
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/compiled.js\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/compiled.js",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/compiled.js",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "compiled.js",
"sourceFileName": "compiled.js",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "compiled"
},
"ignored": false,
"code": "\"use strict\";\n\n!function () {\n function _getCompiled(nools) {\n return function () {\n return function (options) {\n options = options || {};var defined = { Array: Array, String: String, Number: Number, Boolean: Boolean, RegExp: RegExp, Date: Date, Object: Object },\n scope = options.scope || {},\n optDefined = options.defined || {};for (var i in optDefined) defined[i] = optDefined[i];return nools.flow(\"rules\", function () {\n defined.ValidationOutcome = this.addDefined(\"ValidationOutcome\", function () {\n var Defined = function (props) {\n props = props || {}, this.outcome = props.outcome || \"valid\", this.info = props.info || {};\n },\n proto = Defined.prototype;return proto.constructor = function (props) {\n props = props || {}, this.outcome = props.outcome || \"valid\", this.info = props.info || {};\n }, Defined;\n }());var RuleOutcome = defined.RuleOutcome = this.addDefined(\"RuleOutcome\", function () {\n var Defined = function (props) {\n props = props || {}, this.type = props.type || void 0, this.msg = props.msg || \"The rule identified an error\";\n },\n proto = Defined.prototype;return proto.constructor = function (props) {\n props = props || {}, this.type = props.type || void 0, this.msg = props.msg || \"The rule identified an error\";\n }, Defined;\n }()),\n WorkitemModel = defined.WorkitemModel = this.addDefined(\"WorkitemModel\", function () {\n var Defined = function (model, outcomeStructure) {\n this.workitem = model, this.validation = outcomeStructure, this._defType = \"WorkitemModel\";\n },\n proto = Defined.prototype;return proto.constructor = function (model, outcomeStructure) {\n this.workitem = model, this.validation = outcomeStructure, this._defType = \"WorkitemModel\";\n }, Defined;\n }()),\n AppStateModel = defined.AppStateModel = this.addDefined(\"AppStateModel\", function () {\n var Defined = function (model, outcomeStructure) {\n this.appState = model, this.validation = outcomeStructure, this._defType = \"AppStateModel\";\n },\n proto = Defined.prototype;return proto.constructor = function (model, outcomeStructure) {\n this.appState = model, this.validation = outcomeStructure, this._defType = \"AppStateModel\";\n }, Defined;\n }());scope.console = console, this.rule(\"invoiceDateIsDate\", { scope: scope }, [[WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'invoiceDate')\"], [\"not\", WorkitemModel, \"f1\", \"isDate(f1.workitem.invoiceDate)\"], [\"not\", WorkitemModel, \"f1\", \"isDefined(f1.validation['workitem.invoiceDate'].info['invoiceDateIsComplete'])\"]], function (facts, flow) {\n var f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1;defined.Date;var emit = flow.emit,\n ruleName = \"invoiceDateIsDate\";emit(\"activated\", { rule: ruleName });var outcome = new RuleOutcome({ type: \"error\", msg: \"The invoice date is not a valid date object\" });recordOutcome(this, RuleOutcome, f1, \"workitem.invoiceDate\", ruleName, outcome, \"invalid\");\n }), this.rule(\"invoiceDateIsFuture\", { scope: scope }, [[WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'invoiceDate')\"], [\"not\", WorkitemModel, \"f1\", \"f1.workitem.invoiceDate >= now()\"], [AppStateModel, \"f2\", \"f2.appState.userType !== 'admin'\"], [\"not\", WorkitemModel, \"f1\", \"isDefined(f1.validation['workitem.invoiceDate'].info['invoiceDateIsComplete'])\"]], function (facts, flow) {\n var f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1;defined.Date;var emit = flow.emit,\n ruleName = \"invoiceDateIsFuture\";emit(\"activated\", { rule: ruleName });var outcome = new RuleOutcome({ type: \"error\", msg: \"The invoice date must be a future date\" });recordOutcome(this, RuleOutcome, f1, \"workitem.invoiceDate\", ruleName, outcome, \"invalid\");\n }), this.rule(\"invoiceDateIsComplete\", { priority: 1, scope: scope }, [[WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'invoiceDate')\"], [WorkitemModel, \"f1\", \"f1.workitem.invoiceDate === undefined || f1.workitem.invoiceDate === ''\"]], function (facts, flow) {\n var f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1;defined.Date;var emit = flow.emit,\n ruleName = \"invoiceDateIsComplete\";emit(\"activated\", { rule: ruleName });var outcome = new RuleOutcome({ type: \"warning\", msg: \"The invoice date has not been completed\" });recordOutcome(this, RuleOutcome, f1, \"workitem.invoiceDate\", ruleName, outcome, \"incomplete\");\n }), this.rule(\"basNumberLength\", { scope: scope }, [[WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'basNumber')\"], [\"not\", WorkitemModel, \"f\", \"f1.workitem.basNumber =~ /^[0-9]{10}$/\"], [\"not\", WorkitemModel, \"f\", \"isDefined(f1.validation['workitem.basNumber'].info['basNumberIsComplete'])\"]], function (facts, flow) {\n var f1 = facts.f1,\n f1 = facts.f1;facts.f;var f1 = facts.f1;facts.f;var f1 = facts.f1;defined.Number;var emit = flow.emit,\n ruleName = \"basNumberLength\";emit(\"activated\", { rule: ruleName });var outcome = new RuleOutcome({ type: \"error\", msg: \"The BAS number needs to be 10 digits\" });recordOutcome(this, RuleOutcome, f1, \"workitem.basNumber\", ruleName, outcome, \"invalid\");\n }), this.rule(\"basNumberHasInvoiceDate\", { scope: scope }, [[WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'basNumber') AND constraints.hasPath(f1.workitem, 'invoiceDate')\"], [\"not\", WorkitemModel, \"f1\", \"constraints.stringIncludesDate(f1.workitem.basNumber, f1.workitem.invoiceDate)\"], [\"not\", WorkitemModel, \"f1\", \"f1.validation['workitem.basNumber'].outcome === 'incomplete'\"], [\"not\", WorkitemModel, \"f1\", \"f1.validation['workitem.invoiceDate'].outcome === 'incomplete'\"]], function (facts, flow) {\n var f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1;defined.Number, defined.Date;var emit = flow.emit,\n ruleName = \"basNumberHasInvoiceDate\";emit(\"activated\", { rule: ruleName });var outcome = new RuleOutcome({ type: \"error\", msg: \"The BAS number needs to contain the invoice date\" });recordOutcome(this, RuleOutcome, f1, \"workitem.basNumber\", ruleName, outcome, \"invalid\");\n }), this.rule(\"basNumberIsComplete\", { priority: 1, scope: scope }, [[WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'basNumber')\"], [\"not\", WorkitemModel, \"f1\", \"f1.workitem.basNumber !== ''\"]], function (facts, flow) {\n var f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1;defined.Number;var emit = flow.emit,\n ruleName = \"basNumberIsComplete\";emit(\"activated\", { rule: ruleName });var outcome = new RuleOutcome({ type: \"warning\", msg: \"The BAS number has not been completed\" });recordOutcome(this, RuleOutcome, f1, \"workitem.basNumber\", ruleName, outcome, \"incomplete\");\n }), this.rule(\"workitemIsValid\", { scope: scope }, [[WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'basNumber')\"], [WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'invoiceDate')\"], [\"not\", WorkitemModel, \"f1\", \"f1.validation['workitem.basNumber'].outcome === 'valid' AND f1.validation['workitem.invoiceDate'].outcome === 'valid'\"], [\"not\", WorkitemModel, \"f1\", \"constraints.hasPath(f1.validation['workitem'], 'info.workitemIsComplete')\"]], function (facts, flow) {\n var f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1;defined.Number, defined.Date;var emit = flow.emit,\n ruleName = \"workitemIsValid\";emit(\"activated\", { rule: ruleName });var outcome = new RuleOutcome({ type: \"error\", msg: \"The workitem requires the following to be valid:\\n - BAS Number\\n - Invoice Date\" });recordOutcome(this, RuleOutcome, f1, \"workitem\", ruleName, outcome, \"invalid\");\n }), this.rule(\"workitemIsComplete\", { priority: 1, scope: scope }, [[WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'basNumber')\"], [WorkitemModel, \"f1\", \"constraints.hasPath(f1.workitem, 'invoiceDate')\"], [\"or\", [WorkitemModel, \"f1\", \"f1.validation['workitem.basNumber'].outcome === 'incomplete'\"], [WorkitemModel, \"f1\", \"f1.validation['workitem.invoiceDate'].outcome === 'incomplete'\"]]], function (facts, flow) {\n var f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n emit = flow.emit,\n ruleName = \"workitemIsComplete\";emit(\"activated\", { rule: ruleName });var outcome = new RuleOutcome({ type: \"warning\", msg: \"The workitem is not complete\" });recordOutcome(this, RuleOutcome, f1, \"workitem\", ruleName, outcome, \"incomplete\");\n }), this.rule(\"workitemCanCheckout\", { scope: scope }, [[WorkitemModel, \"f1\", \"constraints.hasPath(f1, 'workitem')\"], [AppStateModel, \"f2\", \"constraints.hasPath(f2.appState, 'online')\"], [\"or\", [\"not\", AppStateModel, \"f2\", \"isTrue(f2.appState.online)\"], [\"not\", WorkitemModel, \"f1\", \"f1.validation['workitem'].outcome === 'valid'\"]]], function (facts, flow) {\n var f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n f1 = facts.f1,\n emit = flow.emit,\n ruleName = \"workitemCanCheckout\";emit(\"activated\", { rule: ruleName });var outcome = new RuleOutcome({ type: \"error\", msg: \"The workitem requires the following before checking out:\\n - Online\\n - Workitem\" });recordOutcome(this, RuleOutcome, f1, \"custom.workitem.checkout\", ruleName, outcome, \"invalid\");\n });\n });\n };\n }();\n }\"undefined\" != typeof exports ? \"undefined\" != typeof module && module.exports && (module.exports = _getCompiled(require(\"nools\"))) : \"function\" == typeof define && define.amd ? define([\"nools\"], function (nools) {\n return _getCompiled(nools);\n }) : _getCompiled(this.nools)();\n}.call(undefined);\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbXBpbGVkLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsQ0FBQyxZQUFVO0FBQUMsV0FBUyxZQUFULENBQXNCLEtBQXRCLEVBQTRCO0FBQUMsV0FBTyxZQUFVO0FBQUMsYUFBTyxVQUFTLE9BQVQsRUFBaUI7QUFBQyxrQkFBUSxXQUFTLEVBQWpCLENBQW9CLElBQUksVUFBUSxFQUFDLE9BQU0sS0FBUCxFQUFhLFFBQU8sTUFBcEIsRUFBMkIsUUFBTyxNQUFsQyxFQUF5QyxTQUFRLE9BQWpELEVBQXlELFFBQU8sTUFBaEUsRUFBdUUsTUFBSyxJQUE1RSxFQUFpRixRQUFPLE1BQXhGLEVBQVo7QUFBQSxZQUE0RyxRQUFNLFFBQVEsS0FBUixJQUFlLEVBQWpJO0FBQUEsWUFBb0ksYUFBVyxRQUFRLE9BQVIsSUFBaUIsRUFBaEssQ0FBbUssS0FBSSxJQUFJLENBQVIsSUFBYSxVQUFiLEVBQXdCLFFBQVEsQ0FBUixJQUFXLFdBQVcsQ0FBWCxDQUFYLENBQXlCLE9BQU8sTUFBTSxJQUFOLENBQVcsT0FBWCxFQUFtQixZQUFVO0FBQUMsa0JBQVEsaUJBQVIsR0FBMEIsS0FBSyxVQUFMLENBQWdCLG1CQUFoQixFQUFvQyxZQUFVO0FBQUMsZ0JBQUksVUFBUSxVQUFTLEtBQVQsRUFBZTtBQUFDLHNCQUFNLFNBQU8sRUFBYixFQUFnQixLQUFLLE9BQUwsR0FBYSxNQUF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M,CAAC,KAAD,EAAO,aAAP,EAAqB,IAArB,EAA0B,4BAA1B,CAAN,EAA8D,CAAC,KAAD,EAAO,aAAP,EAAqB,IAArB,EAA0B,+CAA1B,CAA9D,CAA9H,CAA9C,EAAuT,UAAS,KAAT,EAAe,IAAf,EAAoB;AAAC,gBAAI,KAAG,MAAM,EAAb;AAAA,gBAAgB,KAAG,MAAM,EAAzB;AAAA,gBAA4B,KAAG,MAAM,EAArC;AAAA,gBAAwC,KAAG,MAAM,EAAjD;AAAA,gBAAoD,OAAK,KAAK,IAA9D;AAAA,gBAAmE,WAAS,qBAA5E,CAAkG,KAAK,WAAL,EAAiB,EAAC,MAAK,QAAN,EAAjB,EAAkC,IAAI,UAAQ,IAAI,WAAJ,CAAgB,EAAC,MAAK,OAAN,EAAc,KAAI,oFAAlB,EAAhB,CAAZ,CAAqI,cAAc,IAAd,EAAmB,WAAnB,EAA+B,EAA/B,EAAkC,0BAAlC,EAA6D,QAA7D,EAAsE,OAAtE,EAA8E,SAA9E;AAAyF,WAA9qB,CAAzjL;AAAyuM,SAAjtP,CAAP;AAA0tP,OAA39P;AAA49P,KAAv+P,EAAP;AAAi/P,kBAAa,OAAO,OAApB,GAA4B,eAAa,OAAO,MAApB,IAA4B,OAAO,OAAnC,KAA6C,OAAO,OAAP,GAAe,aAAa,QAAQ,OAAR,CAAb,CAA5D,CAA5B,GAAwH,cAAY,OAAO,MAAnB,IAA2B,OAAO,GAAlC,GAAsC,OAAO,CAAC,OAAD,CAAP,EAAiB,UAAS,KAAT,EAAe;AAAC,WAAO,aAAa,KAAb,CAAP;AAA2B,GAA5D,CAAtC,GAAoG,aAAa,KAAK,KAAlB,GAA5N;AAAuP,CAAhxQ,CAAixQ,IAAjxQ,WAAD",
"file": "compiled.js",
"sourcesContent": [
"!function(){function _getCompiled(nools){return function(){return function(options){options=options||{};var defined={Array:Array,String:String,Number:Number,Boolean:Boolean,RegExp:RegExp,Date:Date,Object:Object},scope=options.scope||{},optDefined=options.defined||{};for(var i in optDefined)defined[i]=optDefined[i];return nools.flow(\"rules\",function(){defined.ValidationOutcome=this.addDefined(\"ValidationOutcome\",function(){var Defined=function(props){props=props||{},this.outcome=props.outcome||\"valid\",this.info=props.info||{}},proto=Defined.prototype;return proto.constructor=function(props){props=props||{},this.outcome=props.outcome||\"valid\",this.info=props.info||{}},Defined}());var RuleOutcome=defined.RuleOutcome=this.addDefined(\"RuleOutcome\",function(){var Defined=function(props){props=props||{},this.type=props.type||void 0,this.msg=props.msg||\"The rule identified an error\"},proto=Defined.prototype;return proto.constructor=function(props){props=props||{},this.type=props.type||void 0,this.msg=props.msg||\"The rule identified an error\"},Defined}()),WorkitemModel=defined.WorkitemModel=this.addDefined(\"WorkitemModel\",function(){var Defined=function(model,outcomeStructure){this.workitem=model,this.validation=outcomeStructure,this._defType=\"WorkitemModel\"},proto=Defined.prototype;return proto.constructor=function(model,outcomeStructure){this.workitem=model,this.validation=outcomeStructure,this._defType=\"WorkitemModel\"},Defined}()),AppStateModel=defined.AppStateModel=this.addDefined(\"AppStateModel\",function(){var Defined=function(model,outcomeStructure){this.appState=model,this.validation=outcomeStructure,this._defType=\"AppStateModel\"},proto=Defined.prototype;return proto.constructor=function(model,outcomeStructure){this.appState=model,this.validation=outcomeStructure,this._defType=\"AppStateModel\"},Defined}());scope.console=console,this.rule(\"invoiceDateIsDate\",{scope:scope},[[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'invoiceDate')\"],[\"not\",WorkitemModel,\"f1\",\"isDate(f1.workitem.invoiceDate)\"],[\"not\",WorkitemModel,\"f1\",\"isDefined(f1.validation['workitem.invoiceDate'].info['invoiceDateIsComplete'])\"]],function(facts,flow){var f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1;defined.Date;var emit=flow.emit,ruleName=\"invoiceDateIsDate\";emit(\"activated\",{rule:ruleName});var outcome=new RuleOutcome({type:\"error\",msg:\"The invoice date is not a valid date object\"});recordOutcome(this,RuleOutcome,f1,\"workitem.invoiceDate\",ruleName,outcome,\"invalid\")}),this.rule(\"invoiceDateIsFuture\",{scope:scope},[[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'invoiceDate')\"],[\"not\",WorkitemModel,\"f1\",\"f1.workitem.invoiceDate >= now()\"],[AppStateModel,\"f2\",\"f2.appState.userType !== 'admin'\"],[\"not\",WorkitemModel,\"f1\",\"isDefined(f1.validation['workitem.invoiceDate'].info['invoiceDateIsComplete'])\"]],function(facts,flow){var f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1;defined.Date;var emit=flow.emit,ruleName=\"invoiceDateIsFuture\";emit(\"activated\",{rule:ruleName});var outcome=new RuleOutcome({type:\"error\",msg:\"The invoice date must be a future date\"});recordOutcome(this,RuleOutcome,f1,\"workitem.invoiceDate\",ruleName,outcome,\"invalid\")}),this.rule(\"invoiceDateIsComplete\",{priority:1,scope:scope},[[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'invoiceDate')\"],[WorkitemModel,\"f1\",\"f1.workitem.invoiceDate === undefined || f1.workitem.invoiceDate === ''\"]],function(facts,flow){var f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1;defined.Date;var emit=flow.emit,ruleName=\"invoiceDateIsComplete\";emit(\"activated\",{rule:ruleName});var outcome=new RuleOutcome({type:\"warning\",msg:\"The invoice date has not been completed\"});recordOutcome(this,RuleOutcome,f1,\"workitem.invoiceDate\",ruleName,outcome,\"incomplete\")}),this.rule(\"basNumberLength\",{scope:scope},[[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'basNumber')\"],[\"not\",WorkitemModel,\"f\",\"f1.workitem.basNumber =~ /^[0-9]{10}$/\"],[\"not\",WorkitemModel,\"f\",\"isDefined(f1.validation['workitem.basNumber'].info['basNumberIsComplete'])\"]],function(facts,flow){var f1=facts.f1,f1=facts.f1;facts.f;var f1=facts.f1;facts.f;var f1=facts.f1;defined.Number;var emit=flow.emit,ruleName=\"basNumberLength\";emit(\"activated\",{rule:ruleName});var outcome=new RuleOutcome({type:\"error\",msg:\"The BAS number needs to be 10 digits\"});recordOutcome(this,RuleOutcome,f1,\"workitem.basNumber\",ruleName,outcome,\"invalid\")}),this.rule(\"basNumberHasInvoiceDate\",{scope:scope},[[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'basNumber') AND constraints.hasPath(f1.workitem, 'invoiceDate')\"],[\"not\",WorkitemModel,\"f1\",\"constraints.stringIncludesDate(f1.workitem.basNumber, f1.workitem.invoiceDate)\"],[\"not\",WorkitemModel,\"f1\",\"f1.validation['workitem.basNumber'].outcome === 'incomplete'\"],[\"not\",WorkitemModel,\"f1\",\"f1.validation['workitem.invoiceDate'].outcome === 'incomplete'\"]],function(facts,flow){var f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1;defined.Number,defined.Date;var emit=flow.emit,ruleName=\"basNumberHasInvoiceDate\";emit(\"activated\",{rule:ruleName});var outcome=new RuleOutcome({type:\"error\",msg:\"The BAS number needs to contain the invoice date\"});recordOutcome(this,RuleOutcome,f1,\"workitem.basNumber\",ruleName,outcome,\"invalid\")}),this.rule(\"basNumberIsComplete\",{priority:1,scope:scope},[[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'basNumber')\"],[\"not\",WorkitemModel,\"f1\",\"f1.workitem.basNumber !== ''\"]],function(facts,flow){var f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1;defined.Number;var emit=flow.emit,ruleName=\"basNumberIsComplete\";emit(\"activated\",{rule:ruleName});var outcome=new RuleOutcome({type:\"warning\",msg:\"The BAS number has not been completed\"});recordOutcome(this,RuleOutcome,f1,\"workitem.basNumber\",ruleName,outcome,\"incomplete\")}),this.rule(\"workitemIsValid\",{scope:scope},[[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'basNumber')\"],[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'invoiceDate')\"],[\"not\",WorkitemModel,\"f1\",\"f1.validation['workitem.basNumber'].outcome === 'valid' AND f1.validation['workitem.invoiceDate'].outcome === 'valid'\"],[\"not\",WorkitemModel,\"f1\",\"constraints.hasPath(f1.validation['workitem'], 'info.workitemIsComplete')\"]],function(facts,flow){var f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1;defined.Number,defined.Date;var emit=flow.emit,ruleName=\"workitemIsValid\";emit(\"activated\",{rule:ruleName});var outcome=new RuleOutcome({type:\"error\",msg:\"The workitem requires the following to be valid:\\n - BAS Number\\n - Invoice Date\"});recordOutcome(this,RuleOutcome,f1,\"workitem\",ruleName,outcome,\"invalid\")}),this.rule(\"workitemIsComplete\",{priority:1,scope:scope},[[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'basNumber')\"],[WorkitemModel,\"f1\",\"constraints.hasPath(f1.workitem, 'invoiceDate')\"],[\"or\",[WorkitemModel,\"f1\",\"f1.validation['workitem.basNumber'].outcome === 'incomplete'\"],[WorkitemModel,\"f1\",\"f1.validation['workitem.invoiceDate'].outcome === 'incomplete'\"]]],function(facts,flow){var f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,emit=flow.emit,ruleName=\"workitemIsComplete\";emit(\"activated\",{rule:ruleName});var outcome=new RuleOutcome({type:\"warning\",msg:\"The workitem is not complete\"});recordOutcome(this,RuleOutcome,f1,\"workitem\",ruleName,outcome,\"incomplete\")}),this.rule(\"workitemCanCheckout\",{scope:scope},[[WorkitemModel,\"f1\",\"constraints.hasPath(f1, 'workitem')\"],[AppStateModel,\"f2\",\"constraints.hasPath(f2.appState, 'online')\"],[\"or\",[\"not\",AppStateModel,\"f2\",\"isTrue(f2.appState.online)\"],[\"not\",WorkitemModel,\"f1\",\"f1.validation['workitem'].outcome === 'valid'\"]]],function(facts,flow){var f1=facts.f1,f1=facts.f1,f1=facts.f1,f1=facts.f1,emit=flow.emit,ruleName=\"workitemCanCheckout\";emit(\"activated\",{rule:ruleName});var outcome=new RuleOutcome({type:\"error\",msg:\"The workitem requires the following before checking out:\\n - Online\\n - Workitem\"});recordOutcome(this,RuleOutcome,f1,\"custom.workitem.checkout\",ruleName,outcome,\"invalid\")})})}}()}\"undefined\"!=typeof exports?\"undefined\"!=typeof module&&module.exports&&(module.exports=_getCompiled(require(\"nools\"))):\"function\"==typeof define&&define.amd?define([\"nools\"],function(nools){return _getCompiled(nools)}):_getCompiled(this.nools)()}.call(this);"
]
},
"mtime": 1466927154021
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/test.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [
"interopRequireDefault"
],
"marked": [],
"modules": {
"imports": [
{
"source": "./test-transpile",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "createFlow"
}
]
}
],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/test.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/test.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "test.es6",
"sourceFileName": "test.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "test"
},
"ignored": false,
"code": "'use strict';\n\nvar _testTranspile = require('./test-transpile');\n\nvar _testTranspile2 = babelHelpers.interopRequireDefault(_testTranspile);\n\nconsole.log((0, _testTranspile2.default)()); // import nools from 'nools';\n// import * as helpers from '../src/helpers';\n\n// const source = nools.transpile('./test.nools', { name: 'TestFlow' });\n//\n// console.log(source);\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QuZXM2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBT0E7Ozs7QUFFQSxRQUFRLEdBQVIsQ0FBWSw4QkFBWixFIiwiZmlsZSI6InRlc3QuZXM2Iiwic291cmNlc0NvbnRlbnQiOlsiLy8gaW1wb3J0IG5vb2xzIGZyb20gJ25vb2xzJztcbi8vIGltcG9ydCAqIGFzIGhlbHBlcnMgZnJvbSAnLi4vc3JjL2hlbHBlcnMnO1xuXG4vLyBjb25zdCBzb3VyY2UgPSBub29scy50cmFuc3BpbGUoJy4vdGVzdC5ub29scycsIHsgbmFtZTogJ1Rlc3RGbG93JyB9KTtcbi8vXG4vLyBjb25zb2xlLmxvZyhzb3VyY2UpO1xuXG5pbXBvcnQgY3JlYXRlRmxvdyBmcm9tICcuL3Rlc3QtdHJhbnNwaWxlJztcblxuY29uc29sZS5sb2coY3JlYXRlRmxvdygpKTtcbiJdfQ==",
"ast": null,
"map": {
"version": 3,
"sources": [
"test.es6"
],
"names": [],
"mappings": ";;AAOA;;;;AAEA,QAAQ,GAAR,CAAY,8BAAZ,E",
"file": "test.es6",
"sourcesContent": [
"// import nools from 'nools';\n// import * as helpers from '../src/helpers';\n\n// const source = nools.transpile('./test.nools', { name: 'TestFlow' });\n//\n// console.log(source);\n\nimport createFlow from './test-transpile';\n\nconsole.log(createFlow());\n"
]
},
"mtime": 1467034389584
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/models.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [
{
"source": "./outcomes",
"imported": [
"ValidationOutcome"
],
"specifiers": [
{
"kind": "named",
"imported": "ValidationOutcome",
"local": "ValidationOutcome"
}
]
}
],
"exports": {
"exported": [
"generic"
],
"specifiers": [
{
"kind": "local",
"local": "generic",
"exported": "generic"
}
]
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/models.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/models.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "models.es6",
"sourceFileName": "models.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "models"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.generic = undefined;\n\nvar _outcomes = require('./outcomes');\n\n/**\n * Generic Models\n */\n\nclass WorkitemModel {\n constructor(model) {\n this.workitem = model;\n this.validation = {\n 'workitem.state': new _outcomes.ValidationOutcome(),\n workitem: new _outcomes.ValidationOutcome()\n };\n\n // Private\n this._defType = 'WorkitemModel';\n }\n} /* models.es6 */\n\n\nclass AppStateModel {\n constructor(model) {\n this.appState = model;\n this.validation = {};\n\n // Private\n this._defType = 'AppStateModel';\n }\n}\n\nclass PayloadModel {\n constructor(model) {\n this.payload = model;\n this.validation = {};\n\n // Private\n this._defType = 'PayloadModel';\n }\n}\n\nconst generic = exports.generic = {\n WorkitemModel,\n AppStateModel,\n PayloadModel\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1vZGVscy5lczYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUNBOzs7Ozs7QUFNQSxNQUFNLGFBQU4sQ0FBb0I7QUFDbEIsY0FBWSxLQUFaLEVBQW1CO0FBQ2pCLFNBQUssUUFBTCxHQUFnQixLQUFoQjtBQUNBLFNBQUssVUFBTCxHQUFrQjtBQUNoQix3QkFBa0IsaUNBREY7QUFFaEIsZ0JBQVU7QUFGTSxLQUFsQjs7O0FBTUEsU0FBSyxRQUFMLEdBQWdCLGVBQWhCO0FBQ0Q7QUFWaUIsQzs7O0FBYXBCLE1BQU0sYUFBTixDQUFvQjtBQUNsQixjQUFZLEtBQVosRUFBbUI7QUFDakIsU0FBSyxRQUFMLEdBQWdCLEtBQWhCO0FBQ0EsU0FBSyxVQUFMLEdBQWtCLEVBQWxCOzs7QUFHQSxTQUFLLFFBQUwsR0FBZ0IsZUFBaEI7QUFDRDtBQVBpQjs7QUFVcEIsTUFBTSxZQUFOLENBQW1CO0FBQ2pCLGNBQVksS0FBWixFQUFtQjtBQUNqQixTQUFLLE9BQUwsR0FBZSxLQUFmO0FBQ0EsU0FBSyxVQUFMLEdBQWtCLEVBQWxCOzs7QUFHQSxTQUFLLFFBQUwsR0FBZ0IsY0FBaEI7QUFDRDtBQVBnQjs7QUFVWixNQUFNLDRCQUFVO0FBQ3JCLG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ya2l0ZW1Nb2RlbCxcbiAgQXBwU3RhdGVNb2RlbCxcbiAgUGF5bG9hZE1vZGVsLFxufTtcbiJdfQ==",
"ast": null,
"map": {
"version": 3,
"sources": [
"models.es6"
],
"names": [],
"mappings": ";;;;;;;AACA;;;;;;AAMA,MAAM,aAAN,CAAoB;AAClB,cAAY,KAAZ,EAAmB;AACjB,SAAK,QAAL,GAAgB,KAAhB;AACA,SAAK,UAAL,GAAkB;AAChB,wBAAkB,iCADF;AAEhB,gBAAU;AAFM,KAAlB;;;AAMA,SAAK,QAAL,GAAgB,eAAhB;AACD;AAViB,C;;;AAapB,MAAM,aAAN,CAAoB;AAClB,cAAY,KAAZ,EAAmB;AACjB,SAAK,QAAL,GAAgB,KAAhB;AACA,SAAK,UAAL,GAAkB,EAAlB;;;AAGA,SAAK,QAAL,GAAgB,eAAhB;AACD;AAPiB;;AAUpB,MAAM,YAAN,CAAmB;AACjB,cAAY,KAAZ,EAAmB;AACjB,SAAK,OAAL,GAAe,KAAf;AACA,SAAK,UAAL,GAAkB,EAAlB;;;AAGA,SAAK,QAAL,GAAgB,cAAhB;AACD;AAPgB;;AAUZ,MAAM,4BAAU;AACrB,eADqB;AAErB,eAFqB;AAGrB;AAHqB,CAAhB",
"file": "models.es6",
"sourcesContent": [
"/* models.es6 */\nimport { ValidationOutcome } from './outcomes';\n\n/**\n * Generic Models\n */\n\nclass WorkitemModel {\n constructor(model) {\n this.workitem = model;\n this.validation = {\n 'workitem.state': new ValidationOutcome(),\n workitem: new ValidationOutcome(),\n };\n\n // Private\n this._defType = 'WorkitemModel';\n }\n}\n\nclass AppStateModel {\n constructor(model) {\n this.appState = model;\n this.validation = {};\n\n // Private\n this._defType = 'AppStateModel';\n }\n}\n\nclass PayloadModel {\n constructor(model) {\n this.payload = model;\n this.validation = {};\n\n // Private\n this._defType = 'PayloadModel';\n }\n}\n\nexport const generic = {\n WorkitemModel,\n AppStateModel,\n PayloadModel,\n};\n"
]
},
"mtime": 1466965151318
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/outcomes.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [],
"exports": {
"exported": [
"ValidationOutcome",
"RuleOutcome"
],
"specifiers": [
{
"kind": "local",
"local": "ValidationOutcome",
"exported": "ValidationOutcome"
},
{
"kind": "local",
"local": "RuleOutcome",
"exported": "RuleOutcome"
}
]
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/outcomes.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/outcomes.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "outcomes.es6",
"sourceFileName": "outcomes.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "outcomes"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/* outcomes.es6 */\n\n/**\n * The validation status of a partiticular entity\n *\n * @param props: object of properties of the validation status\n * outcome: the status of the validation at this point ['valid' | 'invalid' | 'incomplete']\n * info: an array of outcome information pertaining to the validation\n *\n * NOTE The validation outcome will start as being valid. The rule engine operates\n * on the principle of attempting to identify and add errors to the an outcome throughout the ruleset.\n * If no errors are added, the validity of the outcome remains.\n */\nclass ValidationOutcome {\n constructor(props) {\n const _props = props || {};\n this.outcome = _props.outcome || 'valid';\n this.info = _props.info || {};\n }\n}\n\nexports.ValidationOutcome = ValidationOutcome; /**\n * The outcome of a rule used to track the error reason info around validation\n *\n * @param props: object of properties of the rule outcome\n * type: the type of outcome ['error' | 'warning']\n * msg: the error/warning message\n */\n\nclass RuleOutcome {\n constructor(props) {\n const _props = props || {};\n this.type = _props.type || undefined;\n this.msg = _props.msg || 'The rule identified an error';\n }\n}\nexports.RuleOutcome = RuleOutcome;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm91dGNvbWVzLmVzNiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFhTyxNQUFNLGlCQUFOLENBQXdCO0FBQzdCLGNBQVksS0FBWixFQUFtQjtBQUNqQixVQUFNLFNBQVMsU0FBUyxFQUF4QjtBQUNBLFNBQUssT0FBTCxHQUFlLE9BQU8sT0FBUCxJQUFrQixPQUFqQztBQUNBLFNBQUssSUFBTCxHQUFZLE9BQU8sSUFBUCxJQUFlLEVBQTNCO0FBQ0Q7QUFMNEI7O1FBQWxCLGlCLEdBQUEsaUI7Ozs7Ozs7O0FBZU4sTUFBTSxXQUFOLENBQWtCO0FBQ3ZCLGNBQVksS0FBWixFQUFtQjtBQUNqQixVQUFNLFNBQVMsU0FBUyxFQUF4QjtBQUNBLFNBQUssSUFBTCxHQUFZLE9BQU8sSUFBUCxJQUFlLFNBQTNCO0FBQ0EsU0FBSyxHQUFMLEdBQVcsT0FBTyxHQUFQLElBQWMsOEJBQXpCO0FBQ0Q7QUFMc0I7UUFBWixXLEdBQUEsVyIsImZpbGUiOiJvdXRjb21lcy5lczYiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBvdXRjb21lcy5lczYgKi9cblxuLyoqXG4g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RyYWNrIHRoZSBlcnJvciByZWFzb24gaW5mbyBhcm91bmQgdmFsaWRhdGlvblxuICpcbiAqIEBwYXJhbSBwcm9wczogb2JqZWN0IG9mIHByb3BlcnRpZXMgb2YgdGhlIHJ1bGUgb3V0Y29tZVxuICogICAgICAgICAgICAgICAgICAgICAgdHlwZTogdGhlIHR5cGUgb2Ygb3V0Y29tZSBbJ2Vycm9yJyB8ICd3YXJuaW5nJ11cbiAqICAgICAgICAgICAgICAgICAgICAgIG1zZzogdGhlIGVycm9yL3dhcm5pbmcgbWVzc2FnZVxuICovXG5leHBvcnQgY2xhc3MgUnVsZU91dGNvbWUge1xuICBjb25zdHJ1Y3Rvcihwcm9wcykge1xuICAgIGNvbnN0IF9wcm9wcyA9IHByb3BzIHx8IHt9O1xuICAgIHRoaXMudHlwZSA9IF9wcm9wcy50eXBlIHx8IHVuZGVmaW5lZDtcbiAgICB0aGlzLm1zZyA9IF9wcm9wcy5tc2cgfHwgJ1RoZSBydWxlIGlkZW50aWZpZWQgYW4gZXJyb3InO1xuICB9XG59XG4iXX0=",
"ast": null,
"map": {
"version": 3,
"sources": [
"outcomes.es6"
],
"names": [],
"mappings": ";;;;;;;;;;;;;;;;;;AAaO,MAAM,iBAAN,CAAwB;AAC7B,cAAY,KAAZ,EAAmB;AACjB,UAAM,SAAS,SAAS,EAAxB;AACA,SAAK,OAAL,GAAe,OAAO,OAAP,IAAkB,OAAjC;AACA,SAAK,IAAL,GAAY,OAAO,IAAP,IAAe,EAA3B;AACD;AAL4B;;QAAlB,iB,GAAA,iB;;;;;;;;AAeN,MAAM,WAAN,CAAkB;AACvB,cAAY,KAAZ,EAAmB;AACjB,UAAM,SAAS,SAAS,EAAxB;AACA,SAAK,IAAL,GAAY,OAAO,IAAP,IAAe,SAA3B;AACA,SAAK,GAAL,GAAW,OAAO,GAAP,IAAc,8BAAzB;AACD;AALsB;QAAZ,W,GAAA,W",
"file": "outcomes.es6",
"sourcesContent": [
"/* outcomes.es6 */\n\n/**\n * The validation status of a partiticular entity\n *\n * @param props: object of properties of the validation status\n * outcome: the status of the validation at this point ['valid' | 'invalid' | 'incomplete']\n * info: an array of outcome information pertaining to the validation\n *\n * NOTE The validation outcome will start as being valid. The rule engine operates\n * on the principle of attempting to identify and add errors to the an outcome throughout the ruleset.\n * If no errors are added, the validity of the outcome remains.\n */\nexport class ValidationOutcome {\n constructor(props) {\n const _props = props || {};\n this.outcome = _props.outcome || 'valid';\n this.info = _props.info || {};\n }\n}\n\n/**\n * The outcome of a rule used to track the error reason info around validation\n *\n * @param props: object of properties of the rule outcome\n * type: the type of outcome ['error' | 'warning']\n * msg: the error/warning message\n */\nexport class RuleOutcome {\n constructor(props) {\n const _props = props || {};\n this.type = _props.type || undefined;\n this.msg = _props.msg || 'The rule identified an error';\n }\n}\n"
]
},
"mtime": 1466964669920
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/test-transpile.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [],
"exports": {
"exported": [
"options"
],
"specifiers": [
{
"kind": "local",
"local": "options",
"exported": "default"
}
]
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/test-transpile.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/examples/test-transpile.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "test-transpile.es6",
"sourceFileName": "test-transpile.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "test-transpile"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (options) {\n options = options || {};\n var bind = function (scope, fn) {\n return function () {\n return fn.apply(scope, arguments);\n };\n },\n defined = {\n Array: Array,\n String: String,\n Number: Number,\n Boolean: Boolean,\n RegExp: RegExp,\n Date: Date,\n Object: Object\n },\n scope = options.scope || {};\n var optDefined = options.defined || {};\n for (var i in optDefined) {\n defined[i] = optDefined[i];\n }\n return nools.flow('TestFlow', function () {\n scope.console = console;\n this.rule('TestRule', {\n \"scope\": scope\n }, [[PayloadModel, \"f1\", \"isDefined(f1.model)\"]], function (facts, flow) {\n var console = scope.console;\n console.log('This worked!');\n });\n });\n};\n\n;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QtdHJhbnNwaWxlLmVzNiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7a0JBQWUsVUFBUyxPQUFULEVBQWtCO0FBQy9CLFlBQVUsV0FBVyxFQUFyQjtBQUNBLE1BQUksT0FBTyxVQUFTLEtBQVQsRUFBZ0IsRUFBaEIsRUFBb0I7QUFDM0IsV0FBTyxZQUFXO0FBQ2hCLGFBQU8sR0FBRyxLQUFILENBQVMsS0FBVCxFQUFnQixTQUFoQixDQUFQO0FBQ0QsS0FGRDtBQUdELEdBSkg7QUFBQSxNQUtFLFVBQVU7QUFDUixXQUFPLEtBREM7QUFFUixZQUFRLE1BRkE7QUFHUixZQUFRLE1BSEE7QUFJUixhQUFTLE9BSkQ7QUFLUixZQUFRLE1BTEE7QUFNUixVQUFNLElBTkU7Q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ICBCb29sZWFuOiBCb29sZWFuLFxuICAgICAgUmVnRXhwOiBSZWdFeHAsXG4gICAgICBEYXRlOiBEYXRlLFxuICAgICAgT2JqZWN0OiBPYmplY3RcbiAgICB9LFxuICAgIHNjb3BlID0gb3B0aW9ucy5zY29wZSB8fCB7fTtcbiAgdmFyIG9wdERlZmluZWQgPSBvcHRpb25zLmRlZmluZWQgfHwge307XG4gIGZvciAodmFyIGkgaW4gb3B0RGVmaW5lZCkge1xuICAgIGRlZmluZWRbaV0gPSBvcHREZWZpbmVkW2ldO1xuICB9XG4gIHJldHVybiBub29scy5mbG93KCdUZXN0RmxvdycsIGZ1bmN0aW9uKCkge1xuICAgIHNjb3BlLmNvbnNvbGUgPSBjb25zb2xlO1xuICAgIHRoaXMucnVsZSgnVGVzdFJ1bGUnLCB7XG4gICAgICBcInNjb3BlXCI6IHNjb3BlXG4gICAgfSwgW1tQYXlsb2FkTW9kZWwsIFwiZjFcIiwgXCJpc0RlZmluZWQoZjEubW9kZWwpXCJdXSwgZnVuY3Rpb24oZmFjdHMsIGZsb3cpIHtcbiAgICAgIHZhciBjb25zb2xlID0gc2NvcGUuY29uc29sZTtcbiAgICAgIGNvbnNvbGUubG9nKCdUaGlzIHdvcmtlZCEnKTtcbiAgICB9KTtcbiAgfSk7XG59O1xuIl19",
"ast": null,
"map": {
"version": 3,
"sources": [
"test-transpile.es6"
],
"names": [],
"mappings": ";;;;;;kBAAe,UAAS,OAAT,EAAkB;AAC/B,YAAU,WAAW,EAArB;AACA,MAAI,OAAO,UAAS,KAAT,EAAgB,EAAhB,EAAoB;AAC3B,WAAO,YAAW;AAChB,aAAO,GAAG,KAAH,CAAS,KAAT,EAAgB,SAAhB,CAAP;AACD,KAFD;AAGD,GAJH;AAAA,MAKE,UAAU;AACR,WAAO,KADC;AAER,YAAQ,MAFA;AAGR,YAAQ,MAHA;AAIR,aAAS,OAJD;AAKR,YAAQ,MALA;AAMR,UAAM,IANE;AAOR,YAAQ;AAPA,GALZ;AAAA,MAcE,QAAQ,QAAQ,KAAR,IAAiB,EAd3B;AAeA,MAAI,aAAa,QAAQ,OAAR,IAAmB,EAApC;AACA,OAAK,IAAI,CAAT,IAAc,UAAd,EAA0B;AACxB,YAAQ,CAAR,IAAa,WAAW,CAAX,CAAb;AACD;AACD,SAAO,MAAM,IAAN,CAAW,UAAX,EAAuB,YAAW;AACvC,UAAM,OAAN,GAAgB,OAAhB;AACA,SAAK,IAAL,CAAU,UAAV,EAAsB;AACpB,eAAS;AADW,KAAtB,EAEG,CAAC,CAAC,YAAD,EAAe,IAAf,EAAqB,qBAArB,CAAD,CAFH,EAEkD,UAAS,KAAT,EAAgB,IAAhB,EAAsB;AACtE,UAAI,UAAU,MAAM,OAApB;AACA,cAAQ,GAAR,CAAY,cAAZ;AACD,KALD;AAMD,GARM,CAAP;AASD,C;;AAAA",
"file": "test-transpile.es6",
"sourcesContent": [
"export default function(options) {\n options = options || {};\n var bind = function(scope, fn) {\n return function() {\n return fn.apply(scope, arguments);\n };\n },\n defined = {\n Array: Array,\n String: String,\n Number: Number,\n Boolean: Boolean,\n RegExp: RegExp,\n Date: Date,\n Object: Object\n },\n scope = options.scope || {};\n var optDefined = options.defined || {};\n for (var i in optDefined) {\n defined[i] = optDefined[i];\n }\n return nools.flow('TestFlow', function() {\n scope.console = console;\n this.rule('TestRule', {\n \"scope\": scope\n }, [[PayloadModel, \"f1\", \"isDefined(f1.model)\"]], function(facts, flow) {\n var console = scope.console;\n console.log('This worked!');\n });\n });\n};\n"
]
},
"mtime": 1467034368602
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/engines/invoice-process-engine.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [
{
"source": "../engine",
"imported": [
"ValidationBase"
],
"specifiers": [
{
"kind": "named",
"imported": "ValidationBase",
"local": "ValidationBase"
}
]
}
],
"exports": {
"exported": [
"InvoiceProcessEngine"
],
"specifiers": [
{
"kind": "local",
"local": "InvoiceProcessEngine",
"exported": "InvoiceProcessEngine"
}
]
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/engines/invoice-process-engine.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/engines/invoice-process-engine.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "invoice-process-engine.es6",
"sourceFileName": "invoice-process-engine.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "invoice-process-engine"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.InvoiceProcessEngine = undefined;\n\nvar _engine = require('../engine');\n\nclass InvoiceProcessEngine extends _engine.ValidationBase {\n constructor() {\n super('invoice-process-rules');\n }\n\n _workitemFacts(model) {\n const WorkItemModel = this._getDefined('WorkItemModel');\n const ValidationOutcome = this._getDefined('ValidationOutcome');\n return new WorkItemModel(model, {\n 'workitem.state': new ValidationOutcome()\n });\n }\n\n validate(models) {\n return super.validate(models).then(session => {\n console.log(session.getFacts());\n return session.getFacts().map(f => f.validation);\n });\n }\n}\n\nexports.InvoiceProcessEngine = InvoiceProcessEngine; /* invoice-process-engine.es6 */\n\ndebugger;\nconst foo = new InvoiceProcessEngine();\nfoo.validate({\n workitem: { state: 'foo' }\n}).then(outcomes => console.log(outcomes));\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImludm9pY2UtcHJvY2Vzcy1lbmdpbmUuZXM2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFDQTs7QUFFTyxNQUFNLG9CQUFOLGdDQUFrRDtBQUN2RCxnQkFBYztBQUNaLFVBQU0sdUJBQU47QUFDRDs7QUFFRCxpQkFBZSxLQUFmLEVBQXNCO0FBQ3BCLFVBQU0sZ0JBQWdCLEtBQUssV0FBTCxDQUFpQixlQUFqQixDQUF0QjtBQUNBLFVBQU0sb0JBQW9CLEtBQUssV0FBTCxDQUFpQixtQkFBakIsQ0FBMUI7QUFDQSxXQUFPLElBQUksYUFBSixDQUFrQixLQUFsQixFQUF5QjtBQUM5Qix3QkFBa0IsSUFBSSxpQkFBSjtBQURZLEtBQXpCLENBQVA7QUFHRDs7QUFFRCxXQUFTLE1BQVQsRUFBaUI7QUFDZixXQUFPLE1BQ0osUUFESSxDQUNLLE1BREwsRUFFSixJQUZJLENBRUMsV0FBVztBQUNmLGNBQVEsR0FBUixDQUFZLFFBQVEsUUFBUixFQUFaO0FBQ0EsYUFBTyxRQUFRLFFBQVIsR0FBbUIsR0FBbkIsQ0FBdUIsS0FBSyxFQUFFLFVBQTlCLENBQVA7QUFDRCxLQUxJLENBQVA7QUFNRDtBQXBCc0Q7O1FBQTVDLG9CLEdBQUEsb0I7O0FBdUJiO0FBQ0EsTUFBTSxNQUFNLElBQUksb0JBQUosRUFBWjtBQUNBLElBQUksUUFBSixDQUFhO0FBQ1gsWUFBVSxFQUFFLE9BQU8sS0FBVDtBQURDLENBQWIsRUFHQyxJQUhELENBR00sWUFBWSxRQUFRLEdBQVIsQ0FBWSxRQUFaLENBSGxCIiwiZmlsZSI6Imludm9pY2UtcHJvY2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sXG59KVxuLnRoZW4ob3V0Y29tZXMgPT4gY29uc29sZS5sb2cob3V0Y29tZXMpKTtcbiJdfQ==",
"ast": null,
"map": {
"version": 3,
"sources": [
"invoice-process-engine.es6"
],
"names": [],
"mappings": ";;;;;;;AACA;;AAEO,MAAM,oBAAN,gCAAkD;AACvD,gBAAc;AACZ,UAAM,uBAAN;AACD;;AAED,iBAAe,KAAf,EAAsB;AACpB,UAAM,gBAAgB,KAAK,WAAL,CAAiB,eAAjB,CAAtB;AACA,UAAM,oBAAoB,KAAK,WAAL,CAAiB,mBAAjB,CAA1B;AACA,WAAO,IAAI,aAAJ,CAAkB,KAAlB,EAAyB;AAC9B,wBAAkB,IAAI,iBAAJ;AADY,KAAzB,CAAP;AAGD;;AAED,WAAS,MAAT,EAAiB;AACf,WAAO,MACJ,QADI,CACK,MADL,EAEJ,IAFI,CAEC,WAAW;AACf,cAAQ,GAAR,CAAY,QAAQ,QAAR,EAAZ;AACA,aAAO,QAAQ,QAAR,GAAmB,GAAnB,CAAuB,KAAK,EAAE,UAA9B,CAAP;AACD,KALI,CAAP;AAMD;AApBsD;;QAA5C,oB,GAAA,oB;;AAuBb;AACA,MAAM,MAAM,IAAI,oBAAJ,EAAZ;AACA,IAAI,QAAJ,CAAa;AACX,YAAU,EAAE,OAAO,KAAT;AADC,CAAb,EAGC,IAHD,CAGM,YAAY,QAAQ,GAAR,CAAY,QAAZ,CAHlB",
"file": "invoice-process-engine.es6",
"sourcesContent": [
"/* invoice-process-engine.es6 */\nimport { ValidationBase } from '../engine';\n\nexport class InvoiceProcessEngine extends ValidationBase {\n constructor() {\n super('invoice-process-rules');\n }\n\n _workitemFacts(model) {\n const WorkItemModel = this._getDefined('WorkItemModel');\n const ValidationOutcome = this._getDefined('ValidationOutcome');\n return new WorkItemModel(model, {\n 'workitem.state': new ValidationOutcome(),\n });\n }\n\n validate(models) {\n return super\n .validate(models)\n .then(session => {\n console.log(session.getFacts());\n return session.getFacts().map(f => f.validation)\n });\n }\n}\n\ndebugger;\nconst foo = new InvoiceProcessEngine();\nfoo.validate({\n workitem: { state: 'foo' },\n})\n.then(outcomes => console.log(outcomes));\n"
]
},
"mtime": 1467051565270
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/engine.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [
"interopRequireDefault"
],
"marked": [],
"modules": {
"imports": [
{
"source": "path",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "path"
}
]
},
{
"source": "nools",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "nools"
}
]
},
{
"source": "./helpers",
"imported": [
"recordOutcome",
"constraints"
],
"specifiers": [
{
"kind": "named",
"imported": "recordOutcome",
"local": "recordOutcome"
},
{
"kind": "named",
"imported": "constraints",
"local": "constraints"
}
]
}
],
"exports": {
"exported": [
"ValidationEngine"
],
"specifiers": [
{
"kind": "local",
"local": "ValidationEngine",
"exported": "ValidationEngine"
}
]
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/engine.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/engine.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "engine.es6",
"sourceFileName": "engine.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "engine"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ValidationEngine = undefined;\n\nvar _path = require('path');\n\nvar _path2 = babelHelpers.interopRequireDefault(_path);\n\nvar _nools = require('nools');\n\nvar _nools2 = babelHelpers.interopRequireDefault(_nools);\n\nvar _helpers = require('./helpers');\n\n/**\n * This class should be extended to define the fact getters as well as encapsulate\n * the validate function, including retrieval of extra data as facts\n *\n * @param flowname: the name of the flow to attempt to use\n */\nclass ValidationEngine {\n constructor(flowName) {\n // Only attempt to compile if flow does not already exist\n if (!_nools2.default.hasFlow(flowName)) {\n // Consolidate options\n const options = {\n name: flowName,\n scope: {\n recordOutcome: _helpers.recordOutcome,\n constraints: _helpers.constraints\n }\n };\n\n // Attempt to compile (hardcoded for now) TODO: Check NODE_ENV\n try {\n this._flow = _nools2.default.compile(_path2.default.join(process.cwd(), '.rules', `${ flowName }.nools`), options);\n } catch (e) {\n throw new Error(`Nools compile returned error:\\n${ e }`);\n }\n\n if (!_nools2.default.hasFlow(flowName)) {\n throw new Error(`Nools flow ${ flowName } not found.`);\n }\n\n this.hasCompiled = true;\n } else {\n this._flow = _nools2.default.getFlow(flowName);\n this.hasCompiled = false;\n }\n }\n\n /**\n * Get a fact definition from the rule source\n *\n * @param name: the name of the defintition\n * @return the definition, if found\n *\n * Will throw an error if the definition cannot be found\n */\n _getDefined(name) {\n return this._flow.getDefined(name);\n }\n\n /**\n * Converts the input models into facts for assertion\n *\n * @param models: an object with a key per model\n * @return an array of facts\n */\n _collectFacts(models) {\n if (typeof models !== 'object') {\n throw new Error('expected modesl to be an object');\n }\n\n return Object.keys(models).reduce((array, key) => {\n const method = `_${ key }Facts`;\n if (!this[method]) {\n throw new Error(`Facts method ${ method } not implemented.`);\n }\n array.push(this[method](models[key]));\n return array;\n }, []);\n }\n\n /**\n * Validate the models\n * @param models: an object with a key per model\n * @return a promise, resolving with the session object, rejecting with the error object\n */\n rawValidate(models) {\n // Collect the facts given the models\n const facts = this._collectFacts(models);\n\n // Create session, asserting the facts\n const session = this._flow.getSession.apply(this._flow, facts);\n\n return new Promise((resolve, reject) => {\n // Execute\n session.match(err => {\n if (err) {\n reject(err);\n } else {\n resolve(session);\n }\n });\n });\n }\n\n /**\n * Validate the models and return verbosely\n * @param models: an object with a key per model\n * @return a promise, resolving with an object including the session and facts,\n * rejecting with the error object\n */\n verboseValidate(models) {\n return this.rawValidate(models).then(session => {\n const facts = session.getFacts();\n const outcomes = {};\n\n // Organise the models\n facts.forEach(fact => {\n Object.keys(fact).forEach(key => {\n if (key !== 'validation' && key !== '_defType') {\n outcomes[`${ key }Model`] = fact;\n }\n });\n });\n\n return {\n session,\n models,\n facts,\n outcomes,\n hasCompiled: this.hasCompiled\n };\n });\n }\n\n /**\n * Validate the models, returning only the errors\n *\n * @param models: an object with a key per model\n * @return a promise, resolving with an object of ValidationOutcomes that are\n * not valid, rejecting with the error object\n */\n validate(models) {\n return this.rawValidate(models).then(session => {\n const errors = {};\n session.getFacts().forEach(fact => {\n for (const key of Object.keys(fact.validation)) {\n // Only do so if the outcome was not valid\n if (fact.validation[key].outcome !== 'valid') {\n if (errors.hasOwnProperty(key)) {\n throw new Error(`More than one \"${ key }\" validation subject exists in validation output`);\n }\n\n // Append the errors object with the validation outcome\n errors[key] = fact.validation[key];\n }\n }\n });\n\n return errors;\n });\n }\n}\nexports.ValidationEngine = ValidationEngine; /* engine.es6 */\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVuZ2luZS5lczYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7Ozs7Ozs7QUFRTyxNQUFNLGdCQUFOLENBQXVCO0FBQzVCLGNBQVksUUFBWixFQUFzQj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ICAgIC8vIE9ubHkgZG8gc28gaWYgdGhlIG91dGNvbWUgd2FzIG5vdCB2YWxpZFxuICAgICAgICAgICAgaWYgKGZhY3QudmFsaWRhdGlvbltrZXldLm91dGNvbWUgIT09ICd2YWxpZCcpIHtcbiAgICAgICAgICAgICAgaWYgKGVycm9ycy5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBNb3JlIHRoYW4gb25lIFwiJHtrZXl9XCIgdmFsaWRhdGlvbiBzdWJqZWN0IGV4aXN0cyBpbiB2YWxpZGF0aW9uIG91dHB1dGApO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gQXBwZW5kIHRoZSBlcnJvcnMgb2JqZWN0IHdpdGggdGhlIHZhbGlkYXRpb24gb3V0Y29tZVxuICAgICAgICAgICAgICBlcnJvcnNba2V5XSA9IGZhY3QudmFsaWRhdGlvbltrZXldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIGVycm9ycztcbiAgICAgIH0pO1xuICB9XG59XG4iXX0=",
"ast": null,
"map": {
"version": 3,
"sources": [
"engine.es6"
],
"names": [],
"mappings": ";;;;;;;AACA;;;;AACA;;;;AACA;;;;;;;;AAQO,MAAM,gBAAN,CAAuB;AAC5B,cAAY,QAAZ,EAAsB;;AAEpB,QAAI,CAAC,gBAAM,OAAN,CAAc,QAAd,CAAL,EAA8B;;AAE5B,YAAM,UAAU;AACd,cAAM,QADQ;AAEd,eAAO;AACL,+CADK;AAEL;AAFK;AAFO,OAAhB;;;AASA,UAAI;AACF,aAAK,KAAL,GAAa,gBAAM,OAAN,CAAc,eAAK,IAAL,CAAU,QAAQ,GAAR,EAAV,EAAyB,QAAzB,EAAoC,IAAE,QAAS,SAA/C,CAAd,EAAuE,OAAvE,CAAb;AACD,OAFD,CAEE,OAAO,CAAP,EAAU;AACV,cAAM,IAAI,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ools from 'nools';\nimport { recordOutcome, constraints } from './helpers';\n\n/**\n * This class should be extended to define the fact getters as well as encapsulate\n * the validate function, including retrieval of extra data as facts\n *\n * @param flowname: the name of the flow to attempt to use\n */\nexport class ValidationEngine {\n constructor(flowName) {\n // Only attempt to compile if flow does not already exist\n if (!nools.hasFlow(flowName)) {\n // Consolidate options\n const options = {\n name: flowName,\n scope: {\n recordOutcome,\n constraints,\n },\n };\n\n // Attempt to compile (hardcoded for now) TODO: Check NODE_ENV\n try {\n this._flow = nools.compile(path.join(process.cwd(), '.rules', `${flowName}.nools`), options);\n } catch (e) {\n throw new Error(`Nools compile returned error:\\n${e}`);\n }\n\n if (!nools.hasFlow(flowName)) {\n throw new Error(`Nools flow ${flowName} not found.`);\n }\n\n this.hasCompiled = true;\n } else {\n this._flow = nools.getFlow(flowName);\n this.hasCompiled = false;\n }\n }\n\n /**\n * Get a fact definition from the rule source\n *\n * @param name: the name of the defintition\n * @return the definition, if found\n *\n * Will throw an error if the definition cannot be found\n */\n _getDefined(name) {\n return this._flow.getDefined(name);\n }\n\n /**\n * Converts the input models into facts for assertion\n *\n * @param models: an object with a key per model\n * @return an array of facts\n */\n _collectFacts(models) {\n if (typeof models !== 'object') {\n throw new Error('expected modesl to be an object');\n }\n\n return Object.keys(models)\n .reduce((array, key) => {\n const method = `_${key}Facts`;\n if (!this[method]) {\n throw new Error(`Facts method ${method} not implemented.`);\n }\n array.push(this[method](models[key]));\n return array;\n }, []);\n }\n\n /**\n * Validate the models\n * @param models: an object with a key per model\n * @return a promise, resolving with the session object, rejecting with the error object\n */\n rawValidate(models) {\n // Collect the facts given the models\n const facts = this._collectFacts(models);\n\n // Create session, asserting the facts\n const session = this._flow.getSession.apply(this._flow, facts);\n\n return new Promise((resolve, reject) => {\n // Execute\n session.match((err) => {\n if (err) {\n reject(err);\n } else {\n resolve(session);\n }\n });\n });\n }\n\n /**\n * Validate the models and return verbosely\n * @param models: an object with a key per model\n * @return a promise, resolving with an object including the session and facts,\n * rejecting with the error object\n */\n verboseValidate(models) {\n return this.rawValidate(models)\n .then((session) => {\n const facts = session.getFacts();\n const outcomes = {};\n\n // Organise the models\n facts.forEach((fact) => {\n Object.keys(fact).forEach((key) => {\n if (key !== 'validation' && key !== '_defType') {\n outcomes[`${key}Model`] = fact;\n }\n });\n });\n\n return {\n session,\n models,\n facts,\n outcomes,\n hasCompiled: this.hasCompiled,\n };\n });\n }\n\n /**\n * Validate the models, returning only the errors\n *\n * @param models: an object with a key per model\n * @return a promise, resolving with an object of ValidationOutcomes that are\n * not valid, rejecting with the error object\n */\n validate(models) {\n return this.rawValidate(models)\n .then((session) => {\n const errors = {};\n session.getFacts().forEach((fact) => {\n for (const key of Object.keys(fact.validation)) {\n // Only do so if the outcome was not valid\n if (fact.validation[key].outcome !== 'valid') {\n if (errors.hasOwnProperty(key)) {\n throw new Error(`More than one \"${key}\" validation subject exists in validation output`);\n }\n\n // Append the errors object with the validation outcome\n errors[key] = fact.validation[key];\n }\n }\n });\n\n return errors;\n });\n }\n}\n"
]
},
"mtime": 1467198278495
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/resources/transpile.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [
"interopRequireDefault"
],
"marked": [],
"modules": {
"imports": [
{
"source": "nools",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "nools"
}
]
},
{
"source": "path",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "path"
}
]
},
{
"source": "fs",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "fs"
}
]
}
],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/resources/transpile.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/resources/transpile.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "transpile.es6",
"sourceFileName": "transpile.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "transpile"
},
"ignored": false,
"code": "'use strict';\n\nvar _nools = require('nools');\n\nvar _nools2 = babelHelpers.interopRequireDefault(_nools);\n\nvar _path = require('path');\n\nvar _path2 = babelHelpers.interopRequireDefault(_path);\n\nvar _fs = require('fs');\n\nvar _fs2 = babelHelpers.interopRequireDefault(_fs);\n\nconst buildDir = _path2.default.join(process.cwd(), 'rules-build'); /* transpile.es6 */\n\nconst sourceDir = _path2.default.join(process.cwd(), '.rules');\n\nfunction transpileFiles(files) {\n files.forEach(file => {\n if (file.endsWith('.nools')) {\n const name = file.split('.nools')[0];\n console.log('Transpiling', name);\n\n try {\n _fs2.default.writeFile(`${ _path2.default.join(buildDir, name) }.js`, `module.exports = ${ _nools2.default.transpile(_path2.default.join(sourceDir, file), { name }) }`);\n } catch (e) {\n throw new Error(`Transpiling '${ name }' returned error:\\n${ e }`);\n }\n }\n });\n}\n\n_fs2.default.mkdirSync(buildDir);\ntranspileFiles(_fs2.default.readdirSync(sourceDir));\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRyYW5zcGlsZS5lczYiXSwibmFtZXMiOltdL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ydCBub29scyBmcm9tICdub29scyc7XG5pbXBvcnQgcGF0aCBmcm9tICdwYXRoJztcbmltcG9ydCBmcyBmcm9tICdmcyc7XG5cbmNvbnN0IGJ1aWxkRGlyID0gcGF0aC5qb2luKHByb2Nlc3MuY3dkKCksICdydWxlcy1idWlsZCcpO1xuY29uc3Qgc291cmNlRGlyID0gcGF0aC5qb2luKHByb2Nlc3MuY3dkKCksICcucnVsZXMnKTtcblxuZnVuY3Rpb24gdHJhbnNwaWxlRmlsZXMoZmlsZXMpIHtcbiAgZmlsZXMuZm9yRWFjaCgoZmlsZSkgPT4ge1xuICAgIGlmIChmaWxlLmVuZHNXaXRoKCcubm9vbHMnKSkge1xuICAgICAgY29uc3QgbmFtZSA9IGZpbGUuc3BsaXQoJy5ub29scycpWzBdO1xuICAgICAgY29uc29sZS5sb2coJ1RyYW5zcGlsaW5nJywgbmFtZSk7XG5cbiAgICAgIHRyeSB7XG4gICAgICAgIGZzLndyaXRlRmlsZShgJHtwYXRoLmpvaW4oYnVpbGREaXIsIG5hbWUpfS5qc2AsIGBtb2R1bGUuZXhwb3J0cyA9ICR7bm9vbHMudHJhbnNwaWxlKHBhdGguam9pbihzb3VyY2VEaXIsIGZpbGUpLCB7IG5hbWUgfSl9YCk7XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihgVHJhbnNwaWxpbmcgJyR7bmFtZX0nIHJldHVybmVkIGVycm9yOlxcbiR7ZX1gKTtcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xufVxuXG5mcy5ta2RpclN5bmMoYnVpbGREaXIpO1xudHJhbnNwaWxlRmlsZXMoZnMucmVhZGRpclN5bmMoc291cmNlRGlyKSk7XG4iXX0=",
"ast": null,
"map": {
"version": 3,
"sources": [
"transpile.es6"
],
"names": [],
"mappings": ";;AACA;;;;AACA;;;;AACA;;;;AAEA,MAAM,WAAW,eAAK,IAAL,CAAU,QAAQ,GAAR,EAAV,EAAyB,aAAzB,CAAjB,C;;AACA,MAAM,YAAY,eAAK,IAAL,CAAU,QAAQ,GAAR,EAAV,EAAyB,QAAzB,CAAlB;;AAEA,SAAS,cAAT,CAAwB,KAAxB,EAA+B;AAC7B,QAAM,OAAN,CAAe,IAAD,IAAU;AACtB,QAAI,KAAK,QAAL,CAAc,QAAd,CAAJ,EAA6B;AAC3B,YAAM,OAAO,KAAK,KAAL,CAAW,QAAX,EAAqB,CAArB,CAAb;AACA,cAAQ,GAAR,CAAY,aAAZ,EAA2B,IAA3B;;AAEA,UAAI;AACF,qBAAG,SAAH,CAAc,IAAE,eAAK,IAAL,CAAU,QAAV,EAAoB,IAApB,CAA0B,MAA1C,EAAiD,qBAAmB,gBAAM,SAAN,CAAgB,eAAK,IAAL,CAAU,SAAV,EAAqB,IAArB,CAAhB,EAA4C,EAAE,IAAF,EAA5C,CAAsD,GAA1H;AACD,OAFD,CAEE,OAAO,CAAP,EAAU;AACV,cAAM,IAAI,KAAJ,CAAW,iBAAe,IAAK,wBAAqB,CAAE,GAAtD,CAAN;AACD;AACF;AACF,GAXD;AAYD;;AAED,aAAG,SAAH,CAAa,QAAb;AACA,eAAe,aAAG,WAAH,CAAe,SAAf,CAAf",
"file": "transpile.es6",
"sourcesContent": [
"/* transpile.es6 */\nimport nools from 'nools';\nimport path from 'path';\nimport fs from 'fs';\n\nconst buildDir = path.join(process.cwd(), 'rules-build');\nconst sourceDir = path.join(process.cwd(), '.rules');\n\nfunction transpileFiles(files) {\n files.forEach((file) => {\n if (file.endsWith('.nools')) {\n const name = file.split('.nools')[0];\n console.log('Transpiling', name);\n\n try {\n fs.writeFile(`${path.join(buildDir, name)}.js`, `module.exports = ${nools.transpile(path.join(sourceDir, file), { name })}`);\n } catch (e) {\n throw new Error(`Transpiling '${name}' returned error:\\n${e}`);\n }\n }\n });\n}\n\nfs.mkdirSync(buildDir);\ntranspileFiles(fs.readdirSync(sourceDir));\n"
]
},
"mtime": 1467113443777
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/resources/transpiler/transpiler.js\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/resources/transpiler/transpiler.js",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/resources/transpiler/transpiler.js",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "transpiler.js",
"sourceFileName": "transpiler.js",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "transpiler"
},
"ignored": false,
"code": "'use strict';\n\nvar extd = require('nools/lib/extended'),\n forEach = extd.forEach,\n indexOf = extd.indexOf,\n merge = extd.merge,\n isString = extd.isString,\n modifiers = require('nools/lib/compile/common').modifiers,\n constraintMatcher = require('nools/lib/constraintMatcher'),\n parser = require('nools/lib/parser');\n\nfunction definedToJs(options) {\n /*jshint evil:true*/\n options = isString(options) ? new Function(\"return \" + options + \";\")() : options;\n var ret = [\"(function(){\"],\n value;\n\n if (options.hasOwnProperty(\"constructor\") && \"function\" === typeof options.constructor) {\n ret.push(\"var Defined = \" + options.constructor.toString() + \";\");\n } else {\n ret.push(\"var Defined = function(opts){ for(var i in opts){if(opts.hasOwnProperty(i)){this[i] = opts[i];}}};\");\n }\n ret.push(\"var proto = Defined.prototype;\");\n for (var key in options) {\n if (options.hasOwnProperty(key)) {\n value = options[key];\n ret.push(\"proto.\" + key + \" = \" + (extd.isFunction(value) ? value.toString() : extd.format(\"%j\", value)) + \";\");\n }\n }\n ret.push(\"return Defined;\");\n ret.push(\"}())\");\n return ret.join(\"\");\n}\n\nfunction actionToJs(action, identifiers, defined, scope) {\n var declares = [],\n usedVars = {};\n forEach(identifiers, function (i) {\n if (action.indexOf(i) !== -1) {\n usedVars[i] = true;\n declares.push(\"var \" + i + \"= facts.\" + i + \";\");\n }\n });\n extd(defined).keys().forEach(function (i) {\n if (action.indexOf(i) !== -1 && !usedVars[i]) {\n usedVars[i] = true;\n declares.push(\"var \" + i + \"= defined.\" + i + \";\");\n }\n });\n\n extd(scope).keys().forEach(function (i) {\n if (action.indexOf(i) !== -1 && !usedVars[i]) {\n usedVars[i] = true;\n declares.push(\"var \" + i + \"= scope.\" + i + \";\");\n }\n });\n extd(modifiers).forEach(function (i) {\n if (action.indexOf(i) !== -1 && !usedVars[i]) {\n declares.push(\"var \" + i + \"= flow.\" + i + \";\");\n }\n });\n var params = [\"facts\", 'flow'];\n if (/next\\(.*\\)/.test(action)) {\n params.push(\"next\");\n }\n action = declares.join(\"\") + action;\n try {\n return [\"function(\", params.join(\",\"), \"){\", action, \"}\"].join(\"\");\n } catch (e) {\n throw new Error(\"Invalid action : \" + action + \"\\n\" + e.message);\n }\n}\n\nfunction parseConstraintModifier(constraint, ret) {\n if (constraint.length && extd.isString(constraint[0])) {\n var modifier = constraint[0].match(\" *(from)\");\n if (modifier) {\n modifier = modifier[0];\n switch (modifier) {\n case \"from\":\n ret.push(', \"', constraint.shift(), '\"');\n break;\n default:\n throw new Error(\"Unrecognized modifier \" + modifier);\n }\n }\n }\n}\n\nfunction parseConstraintHash(constraint, ret, identifiers) {\n if (constraint.length && extd.isHash(constraint[0])) {\n //ret of options\n var refs = constraint.shift();\n extd(refs).values().forEach(function (ident) {\n if (indexOf(identifiers, ident) === -1) {\n identifiers.push(ident);\n }\n });\n ret.push(',' + extd.format('%j', [refs]));\n }\n}\n\nfunction constraintsToJs(constraint, identifiers) {\n constraint = constraint.slice(0);\n var ret = [];\n if (constraint[0] === \"or\") {\n ret.push('[\"' + constraint.shift() + '\"');\n ret.push(extd.map(constraint, function (c) {\n return constraintsToJs(c, identifiers);\n }).join(\",\") + \"]\");\n return ret;\n } else if (constraint[0] === \"not\" || constraint[0] === \"exists\") {\n ret.push('\"', constraint.shift(), '\", ');\n }\n identifiers.push(constraint[1]);\n ret.push(constraint[0], ', \"' + constraint[1].replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + '\"');\n constraint.splice(0, 2);\n if (constraint.length) {\n //constraint\n var c = constraint.shift();\n if (extd.isString(c) && c) {\n ret.push(',\"' + c.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\"), '\"');\n forEach(constraintMatcher.getIdentifiers(parser.parseConstraint(c)), function (i) {\n identifiers.push(i);\n });\n } else {\n ret.push(',\"true\"');\n constraint.unshift(c);\n }\n }\n parseConstraintModifier(constraint, ret);\n parseConstraintHash(constraint, ret, identifiers);\n return '[' + ret.join(\"\") + ']';\n}\n\nexports.transpile = function (flowObj, options) {\n options = options || {};\n var ret = [];\n ret.push(\"module.exports = (function(){\");\n ret.push(\"return function(options){\");\n ret.push(\"options = options || {};\");\n ret.push(\"var bind = function(scope, fn){return function(){return fn.apply(scope, arguments);};}, defined = {Array: Array, String: String, Number: Number, Boolean: Boolean, RegExp: RegExp, Date: Date, Object: Object}, scope = options.scope || {};\");\n ret.push(\"var optDefined = options.defined || {}; for(var i in optDefined){defined[i] = optDefined[i];}\");\n var defined = merge({\n Array: Array,\n String: String,\n Number: Number,\n Boolean: Boolean,\n RegExp: RegExp,\n Date: Date,\n Object: Object\n }, options.define || {});\n if (typeof Buffer !== \"undefined\") {\n defined.Buffer = Buffer;\n }\n var scope = merge({\n console: console\n }, options.scope);\n ret.push([\"return nools.flow('\", options.name, \"', function(){\"].join(\"\"));\n //add any defined classes in the parsed flowObj to defined\n ret.push(extd(flowObj.define || []).map(function (defined) {\n var name = defined.name;\n defined[name] = {};\n return [\"var\", name, \"= defined.\" + name, \"= this.addDefined('\" + name + \"',\", definedToJs(defined.properties) + \");\"].join(\" \");\n }).value().join(\"\\n\"));\n ret.push(extd(flowObj.scope || []).map(function (s) {\n var name = s.name;\n scope[name] = {};\n return [\"var\", name, \"= scope.\" + name, \"= \", s.body, \";\"].join(\" \");\n }).value().join(\"\\n\"));\n ret.push(\"scope.console = console;\\n\");\n\n ret.push(extd(flowObj.rules || []).map(function (rule) {\n var identifiers = [],\n ret = [\"this.rule('\", rule.name.replace(/'/g, \"\\\\'\"), \"'\"],\n options = extd.merge(rule.options || {}, {\n scope: \"scope\"\n });\n ret.push(\",\", extd.format(\"%j\", [options]).replace(/(:\"scope\")/, \":scope\"));\n if (rule.constraints && !extd.isEmpty(rule.constraints)) {\n ret.push(\", [\");\n ret.push(extd(rule.constraints).map(function (c) {\n return constraintsToJs(c, identifiers);\n }).value().join(\",\"));\n ret.push(\"]\");\n }\n ret.push(\",\", actionToJs(rule.action, identifiers, defined, scope));\n ret.push(\");\");\n return ret.join(\"\");\n }).value().join(\"\"));\n ret.push(\"});\");\n ret.push(\"};\");\n ret.push(\"}());\");\n return ret.join(\"\");\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRyYW5zcGlsZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxJQUFJLE9BQU8sUUFBUSxvQkFBUixDQUFYO0FBQUEsSUFDRSxVQUFVLEtBQUssT0FEakI7QUFBQSxJQUVFLFVBQVUsS0FBSyxPQUZqQjtBQUFBLElBR0UsUUFBUSxLQUFLLEtBSGY7QUFBQ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29uc3RyYWludC5zcGxpY2UoMCwgMik7XG4gIGlmIChjb25zdHJhaW50Lmxlbmd0aCkge1xuICAgIC8vY29uc3RyYWludFxuICAgIHZhciBjID0gY29uc3RyYWludC5zaGlmdCgpO1xuICAgIGlmIChleHRkLmlzU3RyaW5nKGMpICYmIGMpIHtcbiAgICAgIHJldC5wdXNoKCcsXCInICsgYy5yZXBsYWNlKC9cXFxcL2csIFwiXFxcXFxcXFxcIikucmVwbGFjZSgvXCIvZywgXCJcXFxcXFxcIlwiKSwgJ1wiJyk7XG4gICAgICBmb3JFYWNoKGNvbnN0cmFpbnRNYXRjaGVyLmdldElkZW50aWZpZXJzKHBhcnNlci5wYXJzZUNvbnN0cmFpbnQoYykpLCBmdW5jdGlvbihpKSB7XG4gICAgICAgIGlkZW50aWZpZXJzLnB1c2goaSk7XG4gICAgICB9KTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0LnB1c2goJyxcInRydWVcIicpO1xuICAgICAgY29uc3RyYWludC51bnNoaWZ0KGMpO1xuICAgIH1cbiAgfVxuICBwYXJzZUNvbnN0cmFpbnRNb2RpZmllcihjb25zdHJhaW50LCByZXQpO1xuICBwYXJzZUNvbnN0cmFpbnRIYXNoKGNvbnN0cmFpbnQsIHJldCwgaWRlbnRpZmllcnMpO1xuICByZXR1cm4gJ1snICsgcmV0LmpvaW4oXCJcIikgKyAnXSc7XG59XG5cbmV4cG9ydHMudHJhbnNwaWxlID0gZnVuY3Rpb24oZmxvd09iaiwgb3B0aW9ucykge1xuICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fTtcbiAgdmFyIHJldCA9IFtdO1xuICByZXQucHVzaChcIm1vZHVsZS5leHBvcnRzID0gKGZ1bmN0aW9uKCl7XCIpO1xuICByZXQucHVzaChcInJldHVybiBmdW5jdGlvbihvcHRpb25zKXtcIik7XG4gIHJldC5wdXNoKFwib3B0aW9ucyA9IG9wdGlvbnMgfHwge307XCIpO1xuICByZXQucHVzaChcInZhciBiaW5kID0gZn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gICAgIH0pO1xuICAgIHJldC5wdXNoKFwiLFwiLCBleHRkLmZvcm1hdChcIiVqXCIsIFtvcHRpb25zXSkucmVwbGFjZSgvKDpcInNjb3BlXCIpLywgXCI6c2NvcGVcIikpO1xuICAgIGlmIChydWxlLmNvbnN0cmFpbnRzICYmICFleHRkLmlzRW1wdHkocnVsZS5jb25zdHJhaW50cykpIHtcbiAgICAgIHJldC5wdXNoKFwiLCBbXCIpO1xuICAgICAgcmV0LnB1c2goZXh0ZChydWxlLmNvbnN0cmFpbnRzKS5tYXAoZnVuY3Rpb24oYykge1xuICAgICAgICByZXR1cm4gY29uc3RyYWludHNUb0pzKGMsIGlkZW50aWZpZXJzKTtcbiAgICAgIH0pLnZhbHVlKCkuam9pbihcIixcIikpO1xuICAgICAgcmV0LnB1c2goXCJdXCIpO1xuICAgIH1cbiAgICByZXQucHVzaChcIixcIiwgYWN0aW9uVG9KcyhydWxlLmFjdGlvbiwgaWRlbnRpZmllcnMsIGRlZmluZWQsIHNjb3BlKSk7XG4gICAgcmV0LnB1c2goXCIpO1wiKTtcbiAgICByZXR1cm4gcmV0LmpvaW4oXCJcIik7XG4gIH0pLnZhbHVlKCkuam9pbihcIlwiKSk7XG4gIHJldC5wdXNoKFwifSk7XCIpO1xuICByZXQucHVzaChcIn07XCIpO1xuICByZXQucHVzaChcIn0oKSk7XCIpO1xuICByZXR1cm4gcmV0LmpvaW4oXCJcIik7XG59O1xuIl19",
"ast": null,
"map": {
"version": 3,
"sources": [
"transpiler.js"
],
"names": [],
"mappings": ";;AAAA,IAAI,OAAO,QAAQ,oBAAR,CAAX;AAAA,IACE,UAAU,KAAK,OADjB;AAAA,IAEE,UAAU,KAAK,OAFjB;AAAA,IAGE,QAAQ,KAAK,KAHf;AAAA,IAIE,WAAW,KAAK,QAJlB;AAAA,IAKE,YAAY,QAAQ,0BAAR,EAAoC,SALlD;AAAA,IAME,oBAAoB,QAAQ,6BAAR,CANtB;AAAA,IAOE,SAAS,QAAQ,kBAAR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IAAJ,CAAS,EAAT,CAAP;AACD,GAjBQ,EAiBN,KAjBM,GAiBE,IAjBF,CAiBO,EAjBP,CAAT;AAkBA,MAAI,IAAJ,CAAS,KAAT;AACA,MAAI,IAAJ,CAAS,IAAT;AACA,MAAI,IAAJ,CAAS,OAAT;AACA,SAAO,IAAI,IAAJ,CAAS,EAAT,CAAP;AACD,CA5DD",
"file": "transpiler.js",
"sourcesContent": [
"var extd = require('nools/lib/extended'),\n forEach = extd.forEach,\n indexOf = extd.indexOf,\n merge = extd.merge,\n isString = extd.isString,\n modifiers = require('nools/lib/compile/common').modifiers,\n constraintMatcher = require('nools/lib/constraintMatcher'),\n parser = require('nools/lib/parser');\n\nfunction definedToJs(options) {\n /*jshint evil:true*/\n options = isString(options) ? new Function(\"return \" + options + \";\")() : options;\n var ret = [\"(function(){\"],\n value;\n\n if (options.hasOwnProperty(\"constructor\") && \"function\" === typeof options.constructor) {\n ret.push(\"var Defined = \" + options.constructor.toString() + \";\");\n } else {\n ret.push(\"var Defined = function(opts){ for(var i in opts){if(opts.hasOwnProperty(i)){this[i] = opts[i];}}};\");\n }\n ret.push(\"var proto = Defined.prototype;\");\n for (var key in options) {\n if (options.hasOwnProperty(key)) {\n value = options[key];\n ret.push(\"proto.\" + key + \" = \" + (extd.isFunction(value) ? value.toString() : extd.format(\"%j\", value)) + \";\");\n }\n }\n ret.push(\"return Defined;\");\n ret.push(\"}())\");\n return ret.join(\"\");\n\n}\n\nfunction actionToJs(action, identifiers, defined, scope) {\n var declares = [],\n usedVars = {};\n forEach(identifiers, function(i) {\n if (action.indexOf(i) !== -1) {\n usedVars[i] = true;\n declares.push(\"var \" + i + \"= facts.\" + i + \";\");\n }\n });\n extd(defined).keys().forEach(function(i) {\n if (action.indexOf(i) !== -1 && !usedVars[i]) {\n usedVars[i] = true;\n declares.push(\"var \" + i + \"= defined.\" + i + \";\");\n }\n });\n\n extd(scope).keys().forEach(function(i) {\n if (action.indexOf(i) !== -1 && !usedVars[i]) {\n usedVars[i] = true;\n declares.push(\"var \" + i + \"= scope.\" + i + \";\");\n }\n });\n extd(modifiers).forEach(function(i) {\n if (action.indexOf(i) !== -1 && !usedVars[i]) {\n declares.push(\"var \" + i + \"= flow.\" + i + \";\");\n }\n });\n var params = [\"facts\", 'flow'];\n if (/next\\(.*\\)/.test(action)) {\n params.push(\"next\");\n }\n action = declares.join(\"\") + action;\n try {\n return [\"function(\", params.join(\",\"), \"){\", action, \"}\"].join(\"\");\n } catch (e) {\n throw new Error(\"Invalid action : \" + action + \"\\n\" + e.message);\n }\n}\n\nfunction parseConstraintModifier(constraint, ret) {\n if (constraint.length && extd.isString(constraint[0])) {\n var modifier = constraint[0].match(\" *(from)\");\n if (modifier) {\n modifier = modifier[0];\n switch (modifier) {\n case \"from\":\n ret.push(', \"', constraint.shift(), '\"');\n break;\n default:\n throw new Error(\"Unrecognized modifier \" + modifier);\n }\n }\n }\n}\n\nfunction parseConstraintHash(constraint, ret, identifiers) {\n if (constraint.length && extd.isHash(constraint[0])) {\n //ret of options\n var refs = constraint.shift();\n extd(refs).values().forEach(function(ident) {\n if (indexOf(identifiers, ident) === -1) {\n identifiers.push(ident);\n }\n });\n ret.push(',' + extd.format('%j', [refs]));\n }\n}\n\nfunction constraintsToJs(constraint, identifiers) {\n constraint = constraint.slice(0);\n var ret = [];\n if (constraint[0] === \"or\") {\n ret.push('[\"' + constraint.shift() + '\"');\n ret.push(extd.map(constraint, function(c) {\n return constraintsToJs(c, identifiers);\n }).join(\",\") + \"]\");\n return ret;\n } else if (constraint[0] === \"not\" || constraint[0] === \"exists\") {\n ret.push('\"', constraint.shift(), '\", ');\n }\n identifiers.push(constraint[1]);\n ret.push(constraint[0], ', \"' + constraint[1].replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + '\"');\n constraint.splice(0, 2);\n if (constraint.length) {\n //constraint\n var c = constraint.shift();\n if (extd.isString(c) && c) {\n ret.push(',\"' + c.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\"), '\"');\n forEach(constraintMatcher.getIdentifiers(parser.parseConstraint(c)), function(i) {\n identifiers.push(i);\n });\n } else {\n ret.push(',\"true\"');\n constraint.unshift(c);\n }\n }\n parseConstraintModifier(constraint, ret);\n parseConstraintHash(constraint, ret, identifiers);\n return '[' + ret.join(\"\") + ']';\n}\n\nexports.transpile = function(flowObj, options) {\n options = options || {};\n var ret = [];\n ret.push(\"module.exports = (function(){\");\n ret.push(\"return function(options){\");\n ret.push(\"options = options || {};\");\n ret.push(\"var bind = function(scope, fn){return function(){return fn.apply(scope, arguments);};}, defined = {Array: Array, String: String, Number: Number, Boolean: Boolean, RegExp: RegExp, Date: Date, Object: Object}, scope = options.scope || {};\");\n ret.push(\"var optDefined = options.defined || {}; for(var i in optDefined){defined[i] = optDefined[i];}\");\n var defined = merge({\n Array: Array,\n String: String,\n Number: Number,\n Boolean: Boolean,\n RegExp: RegExp,\n Date: Date,\n Object: Object\n }, options.define || {});\n if (typeof Buffer !== \"undefined\") {\n defined.Buffer = Buffer;\n }\n var scope = merge({\n console: console\n }, options.scope);\n ret.push([\"return nools.flow('\", options.name, \"', function(){\"].join(\"\"));\n //add any defined classes in the parsed flowObj to defined\n ret.push(extd(flowObj.define || []).map(function(defined) {\n var name = defined.name;\n defined[name] = {};\n return [\"var\", name, \"= defined.\" + name, \"= this.addDefined('\" + name + \"',\", definedToJs(defined.properties) + \");\"].join(\" \");\n }).value().join(\"\\n\"));\n ret.push(extd(flowObj.scope || []).map(function(s) {\n var name = s.name;\n scope[name] = {};\n return [\"var\", name, \"= scope.\" + name, \"= \", s.body, \";\"].join(\" \");\n }).value().join(\"\\n\"));\n ret.push(\"scope.console = console;\\n\");\n\n\n ret.push(extd(flowObj.rules || []).map(function(rule) {\n var identifiers = [],\n ret = [\"this.rule('\", rule.name.replace(/'/g, \"\\\\'\"), \"'\"],\n options = extd.merge(rule.options || {}, {\n scope: \"scope\"\n });\n ret.push(\",\", extd.format(\"%j\", [options]).replace(/(:\"scope\")/, \":scope\"));\n if (rule.constraints && !extd.isEmpty(rule.constraints)) {\n ret.push(\", [\");\n ret.push(extd(rule.constraints).map(function(c) {\n return constraintsToJs(c, identifiers);\n }).value().join(\",\"));\n ret.push(\"]\");\n }\n ret.push(\",\", actionToJs(rule.action, identifiers, defined, scope));\n ret.push(\");\");\n return ret.join(\"\");\n }).value().join(\"\"));\n ret.push(\"});\");\n ret.push(\"};\");\n ret.push(\"}());\");\n return ret.join(\"\");\n};\n"
]
},
"mtime": 1467098297299
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/validators/invoice-process-validator.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [
{
"source": "../engine",
"imported": [
"ValidationEngine"
],
"specifiers": [
{
"kind": "named",
"imported": "ValidationEngine",
"local": "ValidationEngine"
}
]
}
],
"exports": {
"exported": [
"validate",
"models"
],
"specifiers": [
{
"kind": "local",
"local": "validate",
"exported": "validate"
},
{
"kind": "local",
"local": "models",
"exported": "models"
}
]
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/validators/invoice-process-validator.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/validators/invoice-process-validator.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "invoice-process-validator.es6",
"sourceFileName": "invoice-process-validator.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "invoice-process-validator"
},
"ignored": false,
"code": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.validate = validate;\n\nvar _engine = require('../engine');\n\nclass InvoiceProcessValidator extends _engine.ValidationEngine {\n constructor() {\n super('invoice-process-rules');\n }\n\n _workitemFacts(model) {\n const WorkItemModel = this._getDefined('WorkItemModel');\n const ValidationOutcome = this._getDefined('ValidationOutcome');\n return new WorkItemModel(model, {\n workitem: new ValidationOutcome(),\n 'custom.workitem.checkout': new ValidationOutcome()\n });\n }\n\n _payloadFacts(model) {\n const PayloadModel = this._getDefined('PayloadModel');\n const ValidationOutcome = this._getDefined('ValidationOutcome');\n return new PayloadModel(model, {\n 'payload.invoiceDate': new ValidationOutcome(),\n 'payload.basNumber': new ValidationOutcome()\n });\n }\n\n _appStateFacts(model) {\n const AppStateModel = this._getDefined('AppStateModel');\n const ValidationOutcome = this._getDefined('ValidationOutcome');\n return new AppStateModel(model, {\n 'appState.online': new ValidationOutcome(),\n 'appState.userType': new ValidationOutcome()\n });\n }\n} /* invoice-process-validator */\n\n\nconst engine = new InvoiceProcessValidator();\n\nfunction validate(models) {\n return engine.validate(models || {\n workitem: { state: 'dummy' }\n });\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImludm9pY2UtcHJvY2Vzcy12YWxpZGF0b3IuZXM2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O1FBc0NnQixRLEdBQUEsUTs7QUFyQ2hCOztBQUVBLE1BQU0sdUJBQU4sa0NBQXVEO0FBQ3JELGdCQUFjO0FBQ1osVUFBTSx1QkFBTjtBQUNEOztBQUVELGlCQUFl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XG4gICAgICAncGF5bG9hZC5pbnZvaWNlRGF0ZSc6IG5ldyBWYWxpZGF0aW9uT3V0Y29tZSgpLFxuICAgICAgJ3BheWxvYWQuYmFzTnVtYmVyJzogbmV3IFZhbGlkYXRpb25PdXRjb21lKCksXG4gICAgfSk7XG4gIH1cblxuICBfYXBwU3RhdGVGYWN0cyhtb2RlbCkge1xuICAgIGNvbnN0IEFwcFN0YXRlTW9kZWwgPSB0aGlzLl9nZXREZWZpbmVkKCdBcHBTdGF0ZU1vZGVsJyk7XG4gICAgY29uc3QgVmFsaWRhdGlvbk91dGNvbWUgPSB0aGlzLl9nZXREZWZpbmVkKCdWYWxpZGF0aW9uT3V0Y29tZScpO1xuICAgIHJldHVybiBuZXcgQXBwU3RhdGVNb2RlbChtb2RlbCwge1xuICAgICAgJ2FwcFN0YXRlLm9ubGluZSc6IG5ldyBWYWxpZGF0aW9uT3V0Y29tZSgpLFxuICAgICAgJ2FwcFN0YXRlLnVzZXJUeXBlJzogbmV3IFZhbGlkYXRpb25PdXRjb21lKCksXG4gICAgfSk7XG4gIH1cbn1cblxuY29uc3QgZW5naW5lID0gbmV3IEludm9pY2VQcm9jZXNzVmFsaWRhdG9yKCk7XG5cbmV4cG9ydCBmdW5jdGlvbiB2YWxpZGF0ZShtb2RlbHMpIHtcbiAgcmV0dXJuIGVuZ2luZS52YWxpZGF0ZShtb2RlbHMgfHwge1xuICAgIHdvcmtpdGVtOiB7IHN0YXRlOiAnZHVtbXknIH0sXG4gIH0pO1xufVxuIl19",
"ast": null,
"map": {
"version": 3,
"sources": [
"invoice-process-validator.es6"
],
"names": [],
"mappings": ";;;;;QAsCgB,Q,GAAA,Q;;AArChB;;AAEA,MAAM,uBAAN,kCAAuD;AACrD,gBAAc;AACZ,UAAM,uBAAN;AACD;;AAED,iBAAe,KAAf,EAAsB;AACpB,UAAM,gBAAgB,KAAK,WAAL,CAAiB,eAAjB,CAAtB;AACA,UAAM,oBAAoB,KAAK,WAAL,CAAiB,mBAAjB,CAA1B;AACA,WAAO,IAAI,aAAJ,CAAkB,KAAlB,EAAyB;AAC9B,gBAAU,IAAI,iBAAJ,EADoB;AAE9B,kCAA4B,IAAI,iBAAJ;AAFE,KAAzB,CAAP;AAID;;AAED,gBAAc,KAAd,EAAqB;AACnB,UAAM,eAAe,KAAK,WAAL,CAAiB,cAAjB,CAArB;AACA,UAAM,oBAAoB,KAAK,WAAL,CAAiB,mBAAjB,CAA1B;AACA,WAAO,IAAI,YAAJ,CAAiB,KAAjB,EAAwB;AAC7B,6BAAuB,IAAI,iBAAJ,EADM;AAE7B,2BAAqB,IAAI,iBAAJ;AAFQ,KAAxB,CAAP;AAID;;AAED,iBAAe,KAAf,EAAsB;AACpB,UAAM,gBAAgB,KAAK,WAAL,CAAiB,eAAjB,CAAtB;AACA,UAAM,oBAAoB,KAAK,WAAL,CAAiB,mBAAjB,CAA1B;AACA,WAAO,IAAI,aAAJ,CAAkB,KAAlB,EAAyB;AAC9B,yBAAmB,IAAI,iBAAJ,EADW;AAE9B,2BAAqB,IAAI,iBAAJ;AAFS,KAAzB,CAAP;AAID;AA9BoD,C;;;AAiCvD,MAAM,SAAS,IAAI,uBAAJ,EAAf;;AAEO,SAAS,QAAT,CAAkB,MAAlB,EAA0B;AAC/B,SAAO,OAAO,QAAP,CAAgB,UAAU;AAC/B,cAAU,EAAE,OAAO,OAAT;AADqB,GAA1B,CAAP;AAGD",
"file": "invoice-process-validator.es6",
"sourcesContent": [
"/* invoice-process-validator */\nimport { ValidationEngine } from '../engine';\n\nclass InvoiceProcessValidator extends ValidationEngine {\n constructor() {\n super('invoice-process-rules');\n }\n\n _workitemFacts(model) {\n const WorkItemModel = this._getDefined('WorkItemModel');\n const ValidationOutcome = this._getDefined('ValidationOutcome');\n return new WorkItemModel(model, {\n workitem: new ValidationOutcome(),\n 'custom.workitem.checkout': new ValidationOutcome(),\n });\n }\n\n _payloadFacts(model) {\n const PayloadModel = this._getDefined('PayloadModel');\n const ValidationOutcome = this._getDefined('ValidationOutcome');\n return new PayloadModel(model, {\n 'payload.invoiceDate': new ValidationOutcome(),\n 'payload.basNumber': new ValidationOutcome(),\n });\n }\n\n _appStateFacts(model) {\n const AppStateModel = this._getDefined('AppStateModel');\n const ValidationOutcome = this._getDefined('ValidationOutcome');\n return new AppStateModel(model, {\n 'appState.online': new ValidationOutcome(),\n 'appState.userType': new ValidationOutcome(),\n });\n }\n}\n\nconst engine = new InvoiceProcessValidator();\n\nexport function validate(models) {\n return engine.validate(models || {\n workitem: { state: 'dummy' },\n });\n}\n"
]
},
"mtime": 1467105467053
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/engine.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [],
"marked": [],
"modules": {
"imports": [
{
"source": "chai",
"imported": [
"expect"
],
"specifiers": [
{
"kind": "named",
"imported": "expect",
"local": "expect"
}
]
},
{
"source": "mocha",
"imported": [
"describe",
"it"
],
"specifiers": [
{
"kind": "named",
"imported": "describe",
"local": "describe"
},
{
"kind": "named",
"imported": "it",
"local": "it"
}
]
},
{
"source": "../engine",
"imported": [
"ValidationEngine"
],
"specifiers": [
{
"kind": "named",
"imported": "ValidationEngine",
"local": "ValidationEngine"
}
]
}
],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/engine.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/engine.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
],
[
[],
null
]
],
"ignore": [],
"code": true,
"metadata": true,
"ast": false,
"comments": true,
"compact": "auto",
"minified": false,
"sourceMap": "both",
"sourceMaps": "both",
"sourceMapTarget": "engine.es6",
"sourceFileName": "engine.es6",
"babelrc": false,
"sourceType": "module",
"moduleIds": false,
"passPerPreset": false,
"basename": "engine"
},
"ignored": false,
"code": "'use strict';\n\nvar _chai = require('chai');\n\nvar _mocha = require('mocha');\n\nvar _engine = require('../engine');\n\n(0, _mocha.describe)('Engine', () => {\n (0, _mocha.it)('should expose ValidationEngine', () => {\n (0, _chai.expect)(_engine.ValidationEngine).to.exist;\n });\n}); /* eslint max-len:0 */\n/* eslint no-unused-expressions:0 */\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVuZ2luZS5lczYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFHQTs7QUFDQTs7QUFFQTs7QUFFQSxxQkFBUyxRQUFULEVBQW1CLE1BQU07QUFDdkIsaUJBQUcsZ0NBQUgsRUFBcUMsTUFBTTtBQUN6QyxnREFBeUIsRUFBekIsQ0FBNEIsS0FBNUI7QUFDRCxHQUZEO0FBR0QsQ0FKRCxFIiwiZmlsZSI6ImVuZ2luZS5lczYiLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQgbWF4LWxlbjowICovXG4vKiBlc2xpbnQgbm8tdW51c2VkLWV4cHJlc3Npb25zOjAgKi9cblxuaW1wb3J0IHsgZXhwZWN0IH0gZnJvbSAnY2hhaSc7XG5pbXBvcnQgeyBkZXNjcmliZSwgaXQgfSBmcm9tICdtb2NoYSc7XG5cbmltcG9ydCB7IFZhbGlkYXRpb25FbmdpbmUgfSBmcm9tICcuLi9lbmdpbmUnO1xuXG5kZXNjcmliZSgnRW5naW5lJywgKCkgPT4ge1xuICBpdCgnc2hvdWxkIGV4cG9zZSBWYWxpZGF0aW9uRW5naW5lJywgKCkgPT4ge1xuICAgIGV4cGVjdChWYWxpZGF0aW9uRW5naW5lKS50by5leGlzdDtcbiAgfSk7XG59KTtcbiJdfQ==",
"ast": null,
"map": {
"version": 3,
"sources": [
"engine.es6"
],
"names": [],
"mappings": ";;AAGA;;AACA;;AAEA;;AAEA,qBAAS,QAAT,EAAmB,MAAM;AACvB,iBAAG,gCAAH,EAAqC,MAAM;AACzC,gDAAyB,EAAzB,CAA4B,KAA5B;AACD,GAFD;AAGD,CAJD,E",
"file": "engine.es6",
"sourcesContent": [
"/* eslint max-len:0 */\n/* eslint no-unused-expressions:0 */\n\nimport { expect } from 'chai';\nimport { describe, it } from 'mocha';\n\nimport { ValidationEngine } from '../engine';\n\ndescribe('Engine', () => {\n it('should expose ValidationEngine', () => {\n expect(ValidationEngine).to.exist;\n });\n});\n"
]
},
"mtime": 1467103204963
},
"{\"filename\":\"/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/validators/invoice-process-validator.es6\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"babelrc\":true,\"sourceType\":\"module\",\"moduleIds\":false,\"passPerPreset\":false}:6.10.4": {
"metadata": {
"usedHelpers": [
"interopRequireDefault",
"interopRequireWildcard"
],
"marked": [],
"modules": {
"imports": [
{
"source": "chai",
"imported": [
"expect"
],
"specifiers": [
{
"kind": "named",
"imported": "expect",
"local": "expect"
}
]
},
{
"source": "mocha",
"imported": [
"describe",
"it"
],
"specifiers": [
{
"kind": "named",
"imported": "describe",
"local": "describe"
},
{
"kind": "named",
"imported": "it",
"local": "it"
}
]
},
{
"source": "nools",
"imported": [
"default"
],
"specifiers": [
{
"kind": "named",
"imported": "default",
"local": "nools"
}
]
},
{
"source": "../../validators/invoice-process-validator",
"imported": [
"*"
],
"specifiers": [
{
"kind": "namespace",
"local": "invoiceProcessValidator"
}
]
}
],
"exports": {
"exported": [],
"specifiers": []
}
}
},
"options": {
"filename": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/validators/invoice-process-validator.es6",
"filenameRelative": "/mnt/Data/ITDev/gitsub/experimental/v-engine/src/__tests__/validators/invoice-process-validator.es6",
"env": {},
"retainLines": false,
"highlightCode": true,
"suppressDeprecationMessages": false,
"presets": [],
"plugins": [
[
[],
null
],
[
[],
null
],
[
[],
null
],