fng-audit 0.12.0-beta.193 → 0.12.0-beta.195
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/fng-audit.min.js +1 -1
- package/dist/server/fng-audit.js +6 -4
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,s,o,l){return new(o=o||Promise)(function(r,t){function n(e){try{a(l.next(e))}catch(e){t(e)}}function i(e){try{a(l.throw(e))}catch(e){t(e)}}function a(e){var t;e.done?r(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,i)}a((l=l.apply(e,s||[])).next())})},__generator=this&&this.__generator||function(n,i){var a,s,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(a)throw new TypeError("Generator is already executing.");for(;l;)try{if(a=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(o=0<(o=l.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))l.label=t[1];else if(6===t[0]&&l.label<o[1])l.label=o[1],o=t;else{if(!(o&&l.label<o[2])){o[2]&&l.ops.pop(),l.trys.pop();continue}l.label=o[2],l.ops.push(t)}}t=i.call(n,l)}catch(e){t=[6,e],s=0}finally{a=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}};!function(){"use strict";angular.module("fngAuditModule",["formsAngular"]).config(["routingServiceProvider",function(e){e.addRoutes(null,[{route:"/:model/:id/history",state:"model::history",templateUrl:"templates/base-history.html"},{route:"/:model/:form/:id/history",state:"model::history",templateUrl:"templates/base-history.html"},{route:"/:model/:id/changes",state:"model::history",templateUrl:"templates/base-history.html"},{route:"/:model/:form/:id/changes",state:"model::history",templateUrl:"templates/base-history.html"},{route:"/:model/:id/version/:version",state:"model::version",templateUrl:"templates/base-version.html"},{route:"/:model/:form/:id/version/:version",state:"model::version",templateUrl:"templates/base-version.html"}]),e.registerAction("history"),e.registerAction("changes"),e.registerAction("version")}]).controller("FngAuditHistCtrl",["$rootScope","$scope","$location","routingService","fngAuditServ",function(n,i,e,t,a){i.changes=[];var e=e.path(),r=(angular.extend(i,t.parsePathFunc()(e)),"".concat(i.modelName).concat(i.formName?"/".concat(i.formName):""));i.createDate=new Date(1e3*parseInt(i.id.toString().substring(0,8),16)),a.getHist(i.modelName,i.id,e.split("/").slice(-1)[0]).then(function(e){i.changes=e.data;var t,r={};i.changes.forEach(function(e){e.user&&(r[e.user]=null)}),null!=n&&n.describeUsers(r).then(function(t){i.changes.forEach(function(e){e.user&&(e.userDesc=t[e.user])})}),0<i.changes.length?("create"!==i.changes[i.changes.length-1].operation&&(i.inferCreate=!0),t="view",i.changes.forEach(function(e){e.url=t,void 0!==e.oldVersion&&(t="version/"+e.oldVersion)})):a.checkValidItem(i.modelName,i.id).then(function(){i.inferCreate=!0})},function(e){i.errorVisible=!0,i.alertTitle=e.statusText,i.errorMessage=e.data}),i.buildHistUrl=function(e){return t.buildUrl("".concat(r,"/").concat(i.id,"/").concat(e))}}]).controller("FngAuditVerCtrl",["$scope","$location","routingService","fngAuditServ",function(t,e,r,n){t.record=[],angular.extend(t,r.parsePathFunc()(e.$$path)),n.getVersion(t.modelName,t.id,t.tab).then(function(e){"0"===t.tab&&1===Object.keys(e.data).length?(t.errorVisible=!0,t.alertTitle="Error",t.errorMessage="No such ".concat(t.modelName," as ").concat(t.id)):t.version=e.data},function(e){t.errorVisible=!0,t.alertTitle=e.statusText,t.errorMessage=e.data}),t.buildHistUrl=function(e){return r.buildUrl(t.modelName+"/"+t.id+"/version/"+e.oldVersion)}}]).service("fngAuditServ",["$http",function(i){return{getHist:function(t,r,n){return void 0===n&&(n="history"),__awaiter(this,void 0,void 0,function(){return __generator(this,function(e){return[2,i.get("/api/".concat(t,"/").concat(r,"/").concat(n))]})})},getVersion:function(e,t,r){return i.get("/api/".concat(e,"/").concat(t,"/version/").concat(r))},checkValidItem:function(e,t){return i.get("/api/".concat(e,"/").concat(t))}}}])}(),angular.module("fngAuditModule").run(["$templateCache",function(e){"use strict";e.put("templates/base-history.html","<div ng-controller=FngAuditHistCtrl><div ng-class=\"css('rowFluid')\" class=\"page-header list-header\"><div class=header-lhs><h1>History for {{modelName}} {{id}}</h1></div></div><div class=\"page-body list-body\"><error-display></error-display><div ng-class=\"css('rowFluid')\"><a ng-repeat=\"change in changes\" ng-href={{buildHistUrl(change.url)}}><div class=list-item><div ng-class=\"css('span',12)\">{{ change.changedAt | date : 'yy-MM-dd HH:mm:ss' }} UTC <span ng-if=change.chg title=\"{{ change.chg | json}}\"><changes> </span> {{ change.comment }} {{ change.userDesc || (change.user ? (' User: ' + change.user) : '' ) }}</div></div></a></div><div ng-class=\"css('rowFluid')\" ng-show=inferCreate><a ng-href=\"{{buildHistUrl('version/0')}}\"><div class=list-item><div ng-class=\"css('span',12)\">{{ createDate | date : 'yy-MM-dd HH:mm:ss' }} UTC created</div></div></a></div></div></div>"),e.put("templates/base-version.html",'<div ng-controller=FngAuditVerCtrl><div ng-class="css(\'rowFluid\')" class="page-header list-header"><div class=header-lhs><h1>Version {{ tab }} for {{modelName}} {{id}}</h1></div></div><div class="page-body list-body"><error-display></error-display><div ng-class="css(\'rowFluid\')"><pre>\n{{ version | json }}\n</pre></div></div></div>')}]);
|
package/dist/server/fng-audit.js
CHANGED
|
@@ -55,8 +55,9 @@ function controller(fng, processArgs, options) {
|
|
|
55
55
|
res.status(404).send("No such resource as ".concat(req.params.model));
|
|
56
56
|
}
|
|
57
57
|
}]));
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
var retVal = {};
|
|
59
|
+
if (options.userRef) {
|
|
60
|
+
retVal.dependencyChecks = (_a = {},
|
|
60
61
|
_a[options.userRef] = [{
|
|
61
62
|
resource: {
|
|
62
63
|
resourceName: 'audit',
|
|
@@ -64,8 +65,9 @@ function controller(fng, processArgs, options) {
|
|
|
64
65
|
},
|
|
65
66
|
keys: ['user']
|
|
66
67
|
}],
|
|
67
|
-
_a)
|
|
68
|
-
}
|
|
68
|
+
_a);
|
|
69
|
+
}
|
|
70
|
+
return retVal;
|
|
69
71
|
}
|
|
70
72
|
exports.controller = controller;
|
|
71
73
|
function extractPossiblyNestedPath(tree, obj) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fng-audit",
|
|
3
|
-
"version": "0.12.0-beta.
|
|
3
|
+
"version": "0.12.0-beta.195",
|
|
4
4
|
"description": "Client part of forms-angular audit plugin",
|
|
5
5
|
"homepage": "https://www.forms-angular.org/#/plugins",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"async": "3.2.
|
|
10
|
+
"async": "3.2.4",
|
|
11
11
|
"colors": "1.4.0",
|
|
12
12
|
"jsondiffpatch": "0.4.1",
|
|
13
13
|
"lodash": "4.17.21",
|
|
@@ -20,21 +20,21 @@
|
|
|
20
20
|
"main": "./dist/server/fng-audit.js",
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/angular": "1.8.4",
|
|
23
|
-
"@types/async": "3.2.
|
|
24
|
-
"@types/chai": "4.3.
|
|
25
|
-
"@types/express": "4.17.
|
|
26
|
-
"@types/mocha": "
|
|
23
|
+
"@types/async": "3.2.16",
|
|
24
|
+
"@types/chai": "4.3.4",
|
|
25
|
+
"@types/express": "4.17.14",
|
|
26
|
+
"@types/mocha": "10.0.1",
|
|
27
27
|
"angular": "^1.8.3",
|
|
28
|
-
"chai": "4.3.
|
|
29
|
-
"forms-angular": "0.12.0-beta.
|
|
30
|
-
"grunt": "^1.5.
|
|
28
|
+
"chai": "4.3.7",
|
|
29
|
+
"forms-angular": "0.12.0-beta.195",
|
|
30
|
+
"grunt": "^1.5.3",
|
|
31
31
|
"grunt-angular-templates": "^1.2.0",
|
|
32
32
|
"grunt-contrib-concat": "2.1.0",
|
|
33
33
|
"grunt-contrib-copy": "1.0.0",
|
|
34
|
-
"grunt-contrib-uglify": "5.
|
|
34
|
+
"grunt-contrib-uglify": "5.2.2",
|
|
35
35
|
"grunt-legacy-log": "3.0.0",
|
|
36
|
-
"mocha": "^
|
|
37
|
-
"mongoose": "6.
|
|
36
|
+
"mocha": "^10.2.0",
|
|
37
|
+
"mongoose": "6.4.6"
|
|
38
38
|
},
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"authors": [
|