@resolveio/server-lib 20.4.5 → 20.4.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "20.4.5",
3
+ "version": "20.4.6",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "package": "./build_package.sh",
@@ -1,2 +1,2 @@
1
- "use strict";var __awaiter=this&&this.__awaiter||function(e,t,s,o){return new(s=s||Promise)(function(r,n){function fulfilled(e){try{step(o.next(e))}catch(e){n(e)}}function rejected(e){try{step(o.throw(e))}catch(e){n(e)}}function step(e){var n;e.done?r(e.value):((n=e.value)instanceof s?n:new s(function(e){e(n)})).then(fulfilled,rejected)}step((o=o.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(t,s){var o,i,l,u={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},c={next:verb(0),throw:verb(1),return:verb(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function verb(r){return function(e){var n=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;u=c&&n[c=0]?0:u;)try{if(o=1,i&&(l=2&n[0]?i.return:n[0]?i.throw||((l=i.return)&&l.call(i),0):i.next)&&!(l=l.call(i,n[1])).done)return l;switch(i=0,(n=l?[2&n[0],l.value]:n)[0]){case 0:case 1:l=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,i=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(l=0<(l=u.trys).length&&l[l.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!l||n[1]>l[0]&&n[1]<l[3]))u.label=n[1];else if(6===n[0]&&u.label<l[1])u.label=l[1],l=n;else{if(!(l&&u.label<l[2])){l[2]&&u.ops.pop(),u.trys.pop();continue}u.label=l[2],u.ops.push(n)}}n=s.call(t,u)}catch(e){n=[6,e],i=0}finally{o=l=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},user_collection_1=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.loadUserGuidePublications=void 0,require("../collections/user.collection")),user_guide_collection_1=require("../collections/user-guide.collection"),simpl_schema_1=require("simpl-schema");function loadUserGuidePublications(e){e.publications({userGuides:{function:function(){return user_guide_collection_1.UserGuides.find({},{sort:{name:1}})},collections:["user-guides"]},users:{function:function(n){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){switch(e.label){case 0:return[4,user_collection_1.Users.findById(n)];case 1:return e.sent().roles.super_admin?[2,user_collection_1.Users.find({username:{$exists:!0},"other.id_customer":{$exists:!1}},{sort:{fullname:1},projection:{_id:1,__v:1,username:1,email:1,fullname:1,roles:1,active:1,phonenumber:1,other:1,readonly:1,settings:1}})]:[2,user_collection_1.Users.find({$and:[{"roles.super_admin":!1},{username:{$exists:!0}}]},{sort:{fullname:1},projection:{_id:1,__v:1,username:1,email:1,fullname:1,roles:1,active:1,phonenumber:1,other:1,readonly:1,settings:1}})]}})})},collections:["users"],user_specific:!0},allUsers:{function:function(){return user_collection_1.Users.find({username:{$exists:!0}},{sort:{fullname:1},projection:{_id:1,__v:1,username:1,email:1,fullname:1,roles:1,active:1,phonenumber:1,other:1}})},collections:["users"]},customerUsers:{function:function(){return user_collection_1.Users.find({"other.id_customer":{$exists:!0}})},collections:["users"]},userWithId:{function:function(e){return user_collection_1.Users.findById(e)},check:new simpl_schema_1.default({id_user:{type:String}}),collections:["users"]},userLoggedIn:{function:function(e){return user_collection_1.Users.findById(e)},check:new simpl_schema_1.default({id_user:{type:String}}),collections:["users"]},usersWithRole:{function:function(e){return user_collection_1.Users.find({$and:[{$or:[{"roles.groups.name":e},{"roles.groups.views":e},{"roles.approvals.name":e},{"roles.notifications":e},{"roles.miscs":e}]},{active:!0}]},{sort:{fullname:1},projection:{_id:1,__v:1,username:1,email:1,other:1,fullname:1,roles:1,active:1,phonenumber:1}})},check:new simpl_schema_1.default({role:{type:String}}),collections:["users"]}})}exports.loadUserGuidePublications=loadUserGuidePublications;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.loadUserGuidePublications=void 0;var user_guide_collection_1=require("../collections/user-guide.collection");function loadUserGuidePublications(e){e.publications({userGuides:{function:function(){return user_guide_collection_1.UserGuides.find({},{sort:{name:1}})},collections:["user-guides"]}})}exports.loadUserGuidePublications=loadUserGuidePublications;
2
2
  //# sourceMappingURL=user-guides.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/publications/user-guides.ts"],"names":["user_collection_1","require","user_guide_collection_1","simpl_schema_1","loadUserGuidePublications","subscriptionManager","publications","userGuides","function","UserGuides","find","sort","name","collections","users","id_user","Users","findById","_a","sent","roles","super_admin","username","$exists","other.id_customer","fullname","projection","_id","__v","email","active","phonenumber","other","readonly","settings","$and","roles.super_admin","user_specific","allUsers","customerUsers","userWithId","check","default","type","String","userLoggedIn","usersWithRole","role","$or","roles.groups.name","roles.groups.views","roles.approvals.name","roles.notifications","roles.miscs","exports"],"mappings":"k8CAAAA,mB,gGAAAC,QAAA,gCAAA,GACAC,wBAAAD,QAAA,sCAAA,EACAE,eAAAF,QAAA,cAAA,EAEA,SAAgBG,0BAA0BC,GACzCA,EAAoBC,aAAa,CAChCC,WAAY,CACXC,SAAU,WACT,OAAON,wBAAAO,WAAWC,KAAK,GAAI,CAACC,KAAM,CAACC,KAAM,CAAC,CAAC,CAAC,CAC7C,EACAC,YAAa,CAAC,c,EAEfC,MAAO,CACNN,SAAU,SAAeO,G,0GACX,MAAA,CAAA,EAAMf,kBAAAgB,MAAMC,SAASF,CAAO,G,OAEzC,OAFaG,EAAAC,KAAA,EAEIC,MAAOC,YACvB,CAAA,EAAOrB,kBAAAgB,MAAMN,KAAK,CAACY,SAAU,CAACC,QAAS,CAAA,CAAI,EAAGC,oBAAqB,CAACD,QAAS,CAAA,CAAK,CAAC,EAAG,CAACZ,KAAM,CAACc,SAAU,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fgC,aAAc,CACbrC,SAAU,SAASO,GAClB,OAAOf,kBAAAgB,MAAMC,SAASF,CAAO,CAC9B,EACA0B,MAAO,IAAItC,eAAAuC,QAAa,CACvB3B,QAAS,CACR4B,KAAMC,M,EAEP,EACD/B,YAAa,CAAC,Q,EAEfiC,cAAe,CACdtC,SAAU,SAASuC,GAClB,OAAO/C,kBAAAgB,MAAMN,KAAK,CACjByB,KAAM,CACL,CAACa,IAAK,CACL,CAACC,oBAAqBF,CAAI,EAC1B,CAACG,qBAAsBH,CAAI,EAC3B,CAACI,uBAAwBJ,CAAI,EAC7B,CAACK,sBAAuBL,CAAI,EAC5B,CAACM,cAAeN,CAAI,EACpB,EACD,CAACjB,OAAQ,CAAA,CAAI,E,EAEZ,CAACnB,KAAM,CAACc,SAAU,CAAC,EAAGC,WAAY,CAACC,IAAK,EAAGC,IAAK,EAAGN,SAAU,EAAGO,MAAO,EAAGG,MAAO,EAAGP,SAAU,EAAGL,MAAO,EAAGU,OAAQ,EAAGC,YAAa,CAAC,CAAC,CAAC,CAC1I,EACAU,MAAO,IAAItC,eAAAuC,QAAa,CACvBK,KAAM,CACLJ,KAAMC,M,EAEP,EACD/B,YAAa,CAAC,Q,EAEf,CACF,CApFAyC,QAAAlD,0BAAAA","file":"user-guides.js","sourcesContent":["import { Users } from '../collections/user.collection';\nimport { UserGuides } from '../collections/user-guide.collection';\nimport SimpleSchema from 'simpl-schema';\n\nexport function loadUserGuidePublications(subscriptionManager) {\n\tsubscriptionManager.publications({\n\t\tuserGuides: {\n\t\t\tfunction: function() {\n\t\t\t\treturn UserGuides.find({}, {sort: {name: 1}});\n\t\t\t},\n\t\t\tcollections: ['user-guides']\n\t\t},\n\t\tusers: {\n\t\t\tfunction: async function(id_user?: string) {\n\t\t\t\tlet dbUser = await Users.findById(id_user);\n\n\t\t\t\tif ((<any>dbUser.roles).super_admin) {\n\t\t\t\t\treturn Users.find({username: {$exists: true}, 'other.id_customer': {$exists: false}}, {sort: {fullname: 1}, projection: {_id: 1, __v: 1, username: 1, email: 1, fullname: 1, roles: 1, active: 1, phonenumber: 1, other: 1, readonly: 1, settings: 1}});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn Users.find({\n\t\t\t\t\t\t$and: [\n\t\t\t\t\t\t\t{'roles.super_admin': false},\n\t\t\t\t\t\t\t{username: {$exists: true}}\n\t\t\t\t\t\t]\n\t\t\t\t\t}, {sort: {fullname: 1}, projection: {_id: 1, __v: 1, username: 1, email: 1, fullname: 1, roles: 1, active: 1, phonenumber: 1, other: 1, readonly: 1, settings: 1}});\n\t\t\t\t}\n\t\t\t},\n\t\t\tcollections: ['users'],\n\t\t\tuser_specific: true\n\t\t},\n\t\tallUsers: {\n\t\t\tfunction: function() {\n\t\t\t\treturn Users.find({username: {$exists: true}}, {sort: {fullname: 1}, projection: {_id: 1, __v: 1, username: 1, email: 1, fullname: 1, roles: 1, active: 1, phonenumber: 1, other: 1}});\n\t\t\t},\n\t\t\tcollections: ['users']\n\t\t},\n\t\tcustomerUsers: {\n\t\t\tfunction: function() {\n\t\t\t\treturn Users.find({'other.id_customer': {$exists: true}});\n\t\t\t},\n\t\t\tcollections: ['users']\n\t\t},\n\t\tuserWithId: {\n\t\t\tfunction: function(id_user: string) {\n\t\t\t\treturn Users.findById(id_user);\n\t\t\t},\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\tid_user: {\n\t\t\t\t\ttype: String\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcollections: ['users']\n\t\t},\n\t\tuserLoggedIn: {\n\t\t\tfunction: function(id_user: string) {\n\t\t\t\treturn Users.findById(id_user);\n\t\t\t},\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\tid_user: {\n\t\t\t\t\ttype: String\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcollections: ['users']\n\t\t},\n\t\tusersWithRole: {\n\t\t\tfunction: function(role: string) {\n\t\t\t\treturn Users.find({\n\t\t\t\t\t$and: [\n\t\t\t\t\t\t{$or: [\n\t\t\t\t\t\t\t{'roles.groups.name': role},\n\t\t\t\t\t\t\t{'roles.groups.views': role},\n\t\t\t\t\t\t\t{'roles.approvals.name': role},\n\t\t\t\t\t\t\t{'roles.notifications': role},\n\t\t\t\t\t\t\t{'roles.miscs': role},\n\t\t\t\t\t\t]},\n\t\t\t\t\t\t{active: true}\n\t\t\t\t\t]\n\t\t\t\t}, {sort: {fullname: 1}, projection: {_id: 1, __v: 1, username: 1, email: 1, other: 1, fullname: 1, roles: 1, active: 1, phonenumber: 1}});\n\t\t\t},\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\trole: {\n\t\t\t\t\ttype: String\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcollections: ['users']\n\t\t},\n\t});\n}"]}
1
+ {"version":3,"sources":["../../src/publications/user-guides.ts"],"names":["user_guide_collection_1","require","loadUserGuidePublications","subscriptionManager","publications","userGuides","function","UserGuides","find","sort","name","collections","exports"],"mappings":"6GAAA,IAAAA,wBAAAC,QAAA,sCAAA,EAEA,SAAgBC,0BAA0BC,GACzCA,EAAoBC,aAAa,CAChCC,WAAY,CACXC,SAAU,WACT,OAAON,wBAAAO,WAAWC,KAAK,GAAI,CAACC,KAAM,CAACC,KAAM,CAAC,CAAC,CAAC,CAC7C,EACAC,YAAa,CAAC,c,EAEf,CACF,CATAC,QAAAV,0BAAAA","file":"user-guides.js","sourcesContent":["import { UserGuides } from '../collections/user-guide.collection';\n\nexport function loadUserGuidePublications(subscriptionManager) {\n\tsubscriptionManager.publications({\n\t\tuserGuides: {\n\t\t\tfunction: function() {\n\t\t\t\treturn UserGuides.find({}, {sort: {name: 1}});\n\t\t\t},\n\t\t\tcollections: ['user-guides']\n\t\t}\n\t});\n}"]}
package/publications.ts CHANGED
@@ -2,9 +2,6 @@ import { Observable } from 'rxjs';
2
2
 
3
3
  export function SERVER_PUBLICATIONS(resolveioServer) {
4
4
  return {
5
- allUsers: () => {
6
- return <Observable<any>> resolveioServer.subscribe('allUsers');
7
- },
8
5
  appstatus: () => {
9
6
  return <Observable<any>> resolveioServer.subscribe('appstatus');
10
7
  },
@@ -14,9 +11,6 @@ export function SERVER_PUBLICATIONS(resolveioServer) {
14
11
  cronjobsReportBuilderWithIdUser: (id_user: string) => {
15
12
  return <Observable<any>> resolveioServer.subscribe('cronjobsReportBuilderWithIdUser', id_user);
16
13
  },
17
- customerUsers: () => {
18
- return <Observable<any>> resolveioServer.subscribe('customerUsers');
19
- },
20
14
  fileWithId: (id_file: string) => {
21
15
  return <Observable<any>> resolveioServer.subscribe('fileWithId', id_file);
22
16
  },
@@ -86,20 +80,8 @@ export function SERVER_PUBLICATIONS(resolveioServer) {
86
80
  userGuides: () => {
87
81
  return <Observable<any>> resolveioServer.subscribe('userGuides');
88
82
  },
89
- userLoggedIn: (id_user: string) => {
90
- return <Observable<any>> resolveioServer.subscribe('userLoggedIn', id_user);
91
- },
92
- userWithId: (id_user: string) => {
93
- return <Observable<any>> resolveioServer.subscribe('userWithId', id_user);
94
- },
95
83
  usergroups: () => {
96
84
  return <Observable<any>> resolveioServer.subscribe('usergroups');
97
85
  },
98
- users: (id_user?: string) => {
99
- return <Observable<any>> resolveioServer.subscribe('users', id_user);
100
- },
101
- usersWithRole: (role: string) => {
102
- return <Observable<any>> resolveioServer.subscribe('usersWithRole', role);
103
- },
104
86
  };
105
87
  }