@azrico/webobject 1.4.24 → 1.4.26
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.
|
@@ -15,7 +15,7 @@ export declare class WebObject extends SimpleObject {
|
|
|
15
15
|
meta_data: MetaObject[];
|
|
16
16
|
_id: string;
|
|
17
17
|
_creator?: string;
|
|
18
|
-
_created_date
|
|
18
|
+
_created_date?: string | Date;
|
|
19
19
|
constructor(is_readonly?: boolean);
|
|
20
20
|
/**
|
|
21
21
|
* Update meta value of this object , meta data is stored in meta_data variable
|
|
@@ -52,6 +52,8 @@ export declare class WebObject extends SimpleObject {
|
|
|
52
52
|
* @returns value or undefined
|
|
53
53
|
*/
|
|
54
54
|
static getMetaValue(o: WebObject | null | undefined, key: string): any;
|
|
55
|
+
static zipSaveList(svlist: any): string;
|
|
56
|
+
static unzipSaveList(svlist: any): any;
|
|
55
57
|
static saveList(itemList: WebObject[], extraOptions?: {
|
|
56
58
|
[key: string]: any;
|
|
57
59
|
}): Promise<boolean>;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = exports.WebObject = void 0;
|
|
7
7
|
var _SimpleObject2 = _interopRequireDefault(require("../structs/SimpleObject"));
|
|
8
8
|
var _object = require("@azrico/object");
|
|
9
|
+
var _string = require("@azrico/string");
|
|
9
10
|
var _global = require("@azrico/global");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
12
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
@@ -48,7 +49,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
48
49
|
_defineProperty(_assertThisInitialized(_this), "meta_data", void 0);
|
|
49
50
|
_defineProperty(_assertThisInitialized(_this), "_id", "");
|
|
50
51
|
_defineProperty(_assertThisInitialized(_this), "_creator", void 0);
|
|
51
|
-
_defineProperty(_assertThisInitialized(_this), "_created_date",
|
|
52
|
+
_defineProperty(_assertThisInitialized(_this), "_created_date", void 0);
|
|
52
53
|
_defineProperty(_assertThisInitialized(_this), "get_webtype", function () {
|
|
53
54
|
return _this.__web_type || _this.get_webpath();
|
|
54
55
|
});
|
|
@@ -462,6 +463,8 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
462
463
|
_context8.next = 15;
|
|
463
464
|
return this.onAfterSave();
|
|
464
465
|
case 15:
|
|
466
|
+
return _context8.abrupt("return", true);
|
|
467
|
+
case 16:
|
|
465
468
|
case "end":
|
|
466
469
|
return _context8.stop();
|
|
467
470
|
}
|
|
@@ -490,7 +493,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
490
493
|
_context9.next = 3;
|
|
491
494
|
return (_this$manager5 = this.manager) === null || _this$manager5 === void 0 ? void 0 : _this$manager5.onAfterSave.apply(_this$manager5, p);
|
|
492
495
|
case 3:
|
|
493
|
-
return _context9.abrupt("return",
|
|
496
|
+
return _context9.abrupt("return", true);
|
|
494
497
|
case 4:
|
|
495
498
|
case "end":
|
|
496
499
|
return _context9.stop();
|
|
@@ -578,6 +581,21 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
578
581
|
/* -------------------------------------------------------------------------- */
|
|
579
582
|
/* Save */
|
|
580
583
|
/* -------------------------------------------------------------------------- */
|
|
584
|
+
}, {
|
|
585
|
+
key: "zipSaveList",
|
|
586
|
+
value: function zipSaveList(svlist) {
|
|
587
|
+
if (_typeof(svlist) === "object") svlist = JSON.stringify(svlist);
|
|
588
|
+
return (0, _string.string_compress)(svlist);
|
|
589
|
+
}
|
|
590
|
+
}, {
|
|
591
|
+
key: "unzipSaveList",
|
|
592
|
+
value: function unzipSaveList(svlist) {
|
|
593
|
+
try {
|
|
594
|
+
if (_typeof(svlist) === "object") return svlist;
|
|
595
|
+
if (typeof svlist === "string") return JSON.parse((0, _string.string_decompress)(svlist));
|
|
596
|
+
} catch (_unused) {}
|
|
597
|
+
return svlist;
|
|
598
|
+
}
|
|
581
599
|
}, {
|
|
582
600
|
key: "saveList",
|
|
583
601
|
value: function () {
|
|
@@ -636,7 +654,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
636
654
|
case 19:
|
|
637
655
|
_context11.next = 21;
|
|
638
656
|
return _global.gfunc.run_action("post", putAddress, _objectSpread({
|
|
639
|
-
__save_list: save_array
|
|
657
|
+
__save_list: WebObject.zipSaveList(save_array)
|
|
640
658
|
}, extraOptions));
|
|
641
659
|
case 21:
|
|
642
660
|
resultObject = _context11.sent;
|