@azrico/webobject 1.1.27 → 1.1.29
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.
|
@@ -69,17 +69,13 @@ export declare class WebObject extends SimpleObject {
|
|
|
69
69
|
onNew(...p: any): Promise<any>;
|
|
70
70
|
/**
|
|
71
71
|
* get a single web object
|
|
72
|
-
*
|
|
73
|
-
* @param readonly
|
|
74
|
-
* @param fetchID this can be used to prevent loading the same data twice
|
|
72
|
+
* default order of parameters : search,readonly,fetchID
|
|
75
73
|
*/
|
|
76
|
-
static get_single(
|
|
74
|
+
static get_single(...p: any[]): Promise<WebObject | undefined>;
|
|
77
75
|
/**
|
|
78
76
|
* Get a list of web objects
|
|
79
|
-
*
|
|
80
|
-
* @param readonly
|
|
81
|
-
* @param fetchID this can be used to prevent loading the same data twice
|
|
77
|
+
* default order of parameters : search,readonly,fetchID
|
|
82
78
|
*/
|
|
83
|
-
static get_list(
|
|
79
|
+
static get_list<T extends WebObject>(...p: any[]): Promise<T[]>;
|
|
84
80
|
}
|
|
85
81
|
export default WebObject;
|
|
@@ -24,17 +24,13 @@
|
|
|
24
24
|
* @returns
|
|
25
25
|
*/function(){function a(a){return c.apply(this,arguments)}var c=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function c(a){var d,e,f,g,h,i,j,k,l,m,n,o,q=this;return _regeneratorRuntime().wrap(function p(c){for(;1;)switch(c.prev=c.next){case 0:l=function a(){return l=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function c(a){var d;return _regeneratorRuntime().wrap(function e(c){for(;1;)switch(c.prev=c.next){case 0:if(null!=a){c.next=2;break}return c.abrupt("return",void 0);case 2:if(!Array.isArray(a)){c.next=6;break}return c.next=5,Promise.all(a.map(/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){return _regeneratorRuntime().wrap(function c(b){for(;1;)switch(b.prev=b.next){case 0:return b.next=2,k(a);case 2:return b.abrupt("return",b.sent);case 3:case"end":return b.stop();}},b)}));return function(b){return a.apply(this,arguments)}}()));case 5:return c.abrupt("return",c.sent);case 6:if(!(a instanceof b&&"function"==typeof a.get_deltaObject)){c.next=15;break}return c.next=9,a.get_deltaObject({isChild:!0});case 9:if(d=c.sent,(0,_object.object_isEmpty)(d)){c.next=14;break}return c.abrupt("return",d);case 14:return c.abrupt("return",a);case 15:return c.abrupt("return",a);case 16:case"end":return c.stop();}},c)})),l.apply(this,arguments)},k=function b(a){return l.apply(this,arguments)},a||(a={}),d={},e=a.isChild,f=a.useDelta,g=null!=this.__changeables||null!=this.__unchangeables,h=!f&&e&&g?_objectSpread({},this.allproperties):_objectSpread({},this.__delta),i=Object.keys(h),j=g?i.filter(function(a){return _SimpleObject2["default"].canChangeKey(q,a)}):i,m=_createForOfIteratorHelper(j),c.prev=11,m.s();case 13:if((n=m.n()).done){c.next=20;break}return o=n.value,c.next=17,k(h[o]);case 17:d[o]=c.sent;case 18:c.next=13;break;case 20:c.next=25;break;case 22:c.prev=22,c.t0=c["catch"](11),m.e(c.t0);case 25:return c.prev=25,m.f(),c.finish(25);case 28:return c.abrupt("return",d);case 29:case"end":return c.stop();}},c,this,[[11,22,25,28]])}));return a}()/* --------------------------------- Getters -------------------------------- */},{key:"manager",get:function get(){return this.get_managerClass()}},{key:"__web_path",get:function get(){return this.constructor.__web_path}},{key:"__web_type",get:function get(){return this.constructor.__web_type}},{key:"onLoad",value:/* -------------------------------------------------------------------------- */function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function a(){var b,c,d,e,f=arguments;return _regeneratorRuntime().wrap(function g(a){for(;1;)switch(a.prev=a.next){case 0:for(c=f.length,d=Array(c),e=0;e<c;e++)d[e]=f[e];return a.next=3,null===(b=this.manager)||void 0===b?void 0:b.onLoad.apply(b,d);case 3:return a.abrupt("return",a.sent);case 4:case"end":return a.stop();}},a,this)}));return a}()},{key:"onSave",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function a(){var b,c,d,e,f=arguments;return _regeneratorRuntime().wrap(function g(a){for(;1;)switch(a.prev=a.next){case 0:for(c=f.length,d=Array(c),e=0;e<c;e++)d[e]=f[e];return a.next=3,null===(b=this.manager)||void 0===b?void 0:b.onSave.apply(b,d);case 3:return a.abrupt("return",a.sent);case 4:case"end":return a.stop();}},a,this)}));return a}()},{key:"onNew",value:function(){function a(){return b.apply(this,arguments)}var b=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function a(){var b,c,d,e,f=arguments;return _regeneratorRuntime().wrap(function g(a){for(;1;)switch(a.prev=a.next){case 0:for(c=f.length,d=Array(c),e=0;e<c;e++)d[e]=f[e];return a.next=3,null===(b=this.manager)||void 0===b?void 0:b.onNew.apply(b,d);case 3:return a.abrupt("return",a.sent);case 4:case"end":return a.stop();}},a,this)}));return a}()/* -------------------------------------------------------------------------- */ /**
|
|
26
26
|
* get a single web object
|
|
27
|
-
*
|
|
28
|
-
* @param readonly
|
|
29
|
-
* @param fetchID this can be used to prevent loading the same data twice
|
|
27
|
+
* default order of parameters : search,readonly,fetchID
|
|
30
28
|
*/}],[{key:"getMeta",value:function getMeta(a,b){if(null==a)return null;var c=[];return"object"===_typeof(a)&&(c="function"==typeof a.getValue?a.getValue("meta_data"):a.meta_data),(0,_object.getInArray)(c,"key",b)}/**
|
|
31
29
|
* Get meta value by key
|
|
32
30
|
* @param o
|
|
33
31
|
* @param key
|
|
34
32
|
* @returns value or undefined
|
|
35
|
-
*/},{key:"getMetaValue",value:function getMetaValue(a,c){var d;return null===(d=b.getMeta(a,c))||void 0===d?void 0:d.value}},{key:"isResultValid",value:function isResultValid(a){return!(0,_object.object_isEmpty)(a)&&!!(0,_object.object_isTrue)(a.acknowledged)}},{key:"get_single",value:function(){function a(
|
|
33
|
+
*/},{key:"getMetaValue",value:function getMetaValue(a,c){var d;return null===(d=b.getMeta(a,c))||void 0===d?void 0:d.value}},{key:"isResultValid",value:function isResultValid(a){return!(0,_object.object_isEmpty)(a)&&!!(0,_object.object_isTrue)(a.acknowledged)}},{key:"get_single",value:function(){function a(){return c.apply(this,arguments)}var c=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function a(){var c,d,e,f,g,h,i,j,k=arguments;return _regeneratorRuntime().wrap(function l(a){for(;1;)switch(a.prev=a.next){case 0:for(c=k.length,d=Array(c),e=0;e<c;e++)d[e]=k[e];if(f=d.shift(),g=d.shift(),h=d.shift(),!(0,_object.object_isEmpty)(f)){a.next=6;break}return a.abrupt("return",void 0);case 6:j={},j.context=g?"view":"edit",a.t0=_typeof(f),a.next="string"===a.t0?11:"number"===a.t0?11:"object"===a.t0?19:19;break;case 11:return f+="",a.t1=this,a.t2=this,a.next=16,_global.gfunc.run_action("get",this.__web_path+"/"+f,j,{fetchID:h});case 16:return a.t3=a.sent,i=a.t1.ensure.call(a.t1,a.t2,a.t3),a.abrupt("break",25);case 19:return a.t4=_object.object_first,a.next=22,this.get_list(f,g,h);case 22:return a.t5=a.sent,i=(0,a.t4)(a.t5),a.abrupt("break",25);case 25:return b.setReadonly(i,g),a.abrupt("return",i);case 27:case"end":return a.stop();}},a,this)}));return a}()/**
|
|
36
34
|
* Get a list of web objects
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
* @param fetchID this can be used to prevent loading the same data twice
|
|
40
|
-
*/},{key:"get_list",value:function(){function a(a){return c.apply(this,arguments)}var c=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function c(a){var d,e,f,g,h,i=arguments;return _regeneratorRuntime().wrap(function j(c){for(;1;)switch(c.prev=c.next){case 0:return d=!(1<i.length&&void 0!==i[1])||i[1],e=2<i.length&&void 0!==i[2]?i[2]:"",a||(a={}),c.next=5,_global.gfunc.run_action("get",this.__web_path,a,{fetchID:e});case 5:return f=c.sent,g=this.prototype,h=b.map_rowindex(b.mapto(g,f)),b.setReadonly(h,d),c.abrupt("return",h);case 10:case"end":return c.stop();}},c,this)}));return a}()}]),b}(_SimpleObject2["default"]);exports.WebObject=WebObject,_defineProperty(WebObject,"__web_path",""),_defineProperty(WebObject,"__web_type","");var _default=WebObject;exports["default"]=_default;
|
|
35
|
+
* default order of parameters : search,readonly,fetchID
|
|
36
|
+
*/},{key:"get_list",value:function(){function a(){return c.apply(this,arguments)}var c=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function a(){var c,d,e,f,g,h,i,j,k,l=arguments;return _regeneratorRuntime().wrap(function m(a){for(;1;)switch(a.prev=a.next){case 0:for(c=l.length,d=Array(c),e=0;e<c;e++)d[e]=l[e];return f=d.shift(),g=d.shift(),h=d.shift(),f||(f={}),a.next=7,_global.gfunc.run_action("get",this.__web_path,f,{fetchID:h});case 7:return i=a.sent,j=this.prototype,k=b.map_rowindex(b.mapto(j,i)),b.setReadonly(k,g),a.abrupt("return",k);case 12:case"end":return a.stop();}},a,this)}));return a}()}]),b}(_SimpleObject2["default"]);exports.WebObject=WebObject,_defineProperty(WebObject,"__web_path",""),_defineProperty(WebObject,"__web_type","");var _default=WebObject;exports["default"]=_default;
|