@azrico/webobject 1.4.160 → 1.4.161
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/src/WebObjects/WebObject.d.ts +2 -2
- package/dist/src/WebObjects/WebObject.js +5 -5
- package/dist/src/WebObjects/WebObjectManager.d.ts +1 -1
- package/dist/src/WebObjects/WebObjectManager.js +2 -2
- package/dist/src/WebObjects/WebObjectPathHelper.js +4 -4
- package/dist/src/WebObjects/WebObjectPathHelper.test.js +6 -6
- package/package.json +1 -1
|
@@ -85,8 +85,8 @@ export declare class WebObject extends SimpleObject {
|
|
|
85
85
|
get_deltaObject(p?: deltaParams): Promise<any>;
|
|
86
86
|
get manager(): WebObjectManager<any> | undefined;
|
|
87
87
|
get __web_path(): string;
|
|
88
|
-
|
|
89
|
-
static
|
|
88
|
+
get_webpath(): string;
|
|
89
|
+
static get_webpath(): string;
|
|
90
90
|
onDelete(...p: any): Promise<any>;
|
|
91
91
|
onArchive(...p: any): Promise<any>;
|
|
92
92
|
onUnArchive(...p: any): Promise<any>;
|
|
@@ -665,8 +665,8 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
665
665
|
return this.constructor["__web_path"] || this.__db_name;
|
|
666
666
|
}
|
|
667
667
|
}, {
|
|
668
|
-
key: "
|
|
669
|
-
value: function
|
|
668
|
+
key: "get_webpath",
|
|
669
|
+
value: function get_webpath() {
|
|
670
670
|
return this.__web_path || this.__db_name || "";
|
|
671
671
|
}
|
|
672
672
|
}, {
|
|
@@ -1054,7 +1054,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1054
1054
|
if (!extraOptions) extraOptions = {};
|
|
1055
1055
|
chunks = (0, _object.array_chunks)(itemList, (_extraOptions$chunksi = extraOptions.chunksize) !== null && _extraOptions$chunksi !== void 0 ? _extraOptions$chunksi : 50);
|
|
1056
1056
|
delete extraOptions.chunksize;
|
|
1057
|
-
putAddress = this.
|
|
1057
|
+
putAddress = this.get_webpath();
|
|
1058
1058
|
index = 0;
|
|
1059
1059
|
case 6:
|
|
1060
1060
|
if (!(index < chunks.length)) {
|
|
@@ -1148,8 +1148,8 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1148
1148
|
return saveList;
|
|
1149
1149
|
}()
|
|
1150
1150
|
}, {
|
|
1151
|
-
key: "
|
|
1152
|
-
value: function
|
|
1151
|
+
key: "get_webpath",
|
|
1152
|
+
value: function get_webpath() {
|
|
1153
1153
|
return this.__web_path || this.__db_name || "";
|
|
1154
1154
|
}
|
|
1155
1155
|
}, {
|
|
@@ -30,7 +30,7 @@ export declare class WebObjectManager<T extends WebObject> extends ObjectManager
|
|
|
30
30
|
get __web_path(): string;
|
|
31
31
|
get __db_name(): string;
|
|
32
32
|
get __object_name(): string;
|
|
33
|
-
|
|
33
|
+
get_webpath(): string;
|
|
34
34
|
private __getObjectData;
|
|
35
35
|
/**
|
|
36
36
|
* Use this when you load new Object
|
|
@@ -494,8 +494,8 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
494
494
|
return this.__getObjectData(["__object_name", "__db_name"]);
|
|
495
495
|
}
|
|
496
496
|
}, {
|
|
497
|
-
key: "
|
|
498
|
-
value: function
|
|
497
|
+
key: "get_webpath",
|
|
498
|
+
value: function get_webpath() {
|
|
499
499
|
return this.__getObjectData(["__web_path", "__db_name"]);
|
|
500
500
|
}
|
|
501
501
|
}, {
|
|
@@ -36,7 +36,7 @@ var WebObjectPathHelper = exports.WebObjectPathHelper = /*#__PURE__*/function ()
|
|
|
36
36
|
while (1) switch (_context.prev = _context.next) {
|
|
37
37
|
case 0:
|
|
38
38
|
action = String(action).toLowerCase();
|
|
39
|
-
wn = obj.
|
|
39
|
+
wn = obj.get_webpath();
|
|
40
40
|
wp = obj.__web_path;
|
|
41
41
|
usepath = "";
|
|
42
42
|
if (WebObjectPathHelper.pathOverrides[wn] && WebObjectPathHelper.pathOverrides[wn][action]) {
|
|
@@ -111,10 +111,10 @@ var WebObjectPathHelper = exports.WebObjectPathHelper = /*#__PURE__*/function ()
|
|
|
111
111
|
/* ------------------------------ find webname ------------------------------ */
|
|
112
112
|
if (typeof obj === "string") {
|
|
113
113
|
wn = obj;
|
|
114
|
-
} else if (typeof obj.
|
|
115
|
-
wn = obj.
|
|
114
|
+
} else if (typeof obj.get_webpath === "function") {
|
|
115
|
+
wn = obj.get_webpath();
|
|
116
116
|
} else {
|
|
117
|
-
console.error("[override_path]", "given object has no
|
|
117
|
+
console.error("[override_path]", "given object has no get_webpath");
|
|
118
118
|
wn = obj.__web_path || obj.__web_type;
|
|
119
119
|
}
|
|
120
120
|
if (wn) {
|
|
@@ -45,19 +45,19 @@ describe("WebObjectPathHelper", function () {
|
|
|
45
45
|
return _WebObjectPathHelper["default"].get_path(wobj, "save");
|
|
46
46
|
case 3:
|
|
47
47
|
_context.t1 = _context.sent;
|
|
48
|
-
(0, _context.t0)(_context.t1).toBe(wobj.
|
|
48
|
+
(0, _context.t0)(_context.t1).toBe(wobj.get_webpath() + "/" + wobj.getID());
|
|
49
49
|
_context.t2 = expect;
|
|
50
50
|
_context.next = 8;
|
|
51
51
|
return _WebObjectPathHelper["default"].get_path(wobj, "new");
|
|
52
52
|
case 8:
|
|
53
53
|
_context.t3 = _context.sent;
|
|
54
|
-
(0, _context.t2)(_context.t3).toBe(wobj.
|
|
54
|
+
(0, _context.t2)(_context.t3).toBe(wobj.get_webpath());
|
|
55
55
|
_context.t4 = expect;
|
|
56
56
|
_context.next = 13;
|
|
57
57
|
return _WebObjectPathHelper["default"].get_path(wobj, "lock");
|
|
58
58
|
case 13:
|
|
59
59
|
_context.t5 = _context.sent;
|
|
60
|
-
(0, _context.t4)(_context.t5).toBe("".concat(wobj.
|
|
60
|
+
(0, _context.t4)(_context.t5).toBe("".concat(wobj.get_webpath(), "/").concat(wobj.getID(), "/lock"));
|
|
61
61
|
case 15:
|
|
62
62
|
case "end":
|
|
63
63
|
return _context.stop();
|
|
@@ -69,7 +69,7 @@ describe("WebObjectPathHelper", function () {
|
|
|
69
69
|
while (1) switch (_context2.prev = _context2.next) {
|
|
70
70
|
case 0:
|
|
71
71
|
_context2.next = 2;
|
|
72
|
-
return _WebObjectPathHelper["default"].override_path(wobj.
|
|
72
|
+
return _WebObjectPathHelper["default"].override_path(wobj.get_webpath(), "save", "blah");
|
|
73
73
|
case 2:
|
|
74
74
|
_context2.t0 = expect;
|
|
75
75
|
_context2.next = 5;
|
|
@@ -78,7 +78,7 @@ describe("WebObjectPathHelper", function () {
|
|
|
78
78
|
_context2.t1 = _context2.sent;
|
|
79
79
|
(0, _context2.t0)(_context2.t1).toBe("blah");
|
|
80
80
|
_context2.next = 9;
|
|
81
|
-
return _WebObjectPathHelper["default"].override_path(wobj.
|
|
81
|
+
return _WebObjectPathHelper["default"].override_path(wobj.get_webpath(), "save", "{id}");
|
|
82
82
|
case 9:
|
|
83
83
|
_context2.t2 = expect;
|
|
84
84
|
_context2.next = 12;
|
|
@@ -91,7 +91,7 @@ describe("WebObjectPathHelper", function () {
|
|
|
91
91
|
return _WebObjectPathHelper["default"].get_path(wobj, "new");
|
|
92
92
|
case 17:
|
|
93
93
|
_context2.t5 = _context2.sent;
|
|
94
|
-
(0, _context2.t4)(_context2.t5).toBe(wobj.
|
|
94
|
+
(0, _context2.t4)(_context2.t5).toBe(wobj.get_webpath());
|
|
95
95
|
case 19:
|
|
96
96
|
case "end":
|
|
97
97
|
return _context2.stop();
|