@azrico/webobject 1.4.137 → 1.4.138
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.js +74 -39
- package/package.json +5 -5
|
@@ -177,44 +177,60 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
177
177
|
case 2:
|
|
178
178
|
deltaObject = _context2.sent;
|
|
179
179
|
putAction = "post";
|
|
180
|
-
|
|
180
|
+
if (!this.isNew) {
|
|
181
|
+
_context2.next = 10;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
_context2.next = 7;
|
|
185
|
+
return _global.gfilter.apply_filter("".concat(this.get_webname(), "/path/new"), "".concat(this.__web_path));
|
|
186
|
+
case 7:
|
|
187
|
+
_context2.t0 = _context2.sent;
|
|
188
|
+
_context2.next = 13;
|
|
189
|
+
break;
|
|
190
|
+
case 10:
|
|
191
|
+
_context2.next = 12;
|
|
192
|
+
return _global.gfilter.apply_filter("".concat(this.get_webname(), "/path/save"), "".concat(this.__web_path, "/").concat(this.getID()));
|
|
193
|
+
case 12:
|
|
194
|
+
_context2.t0 = _context2.sent;
|
|
195
|
+
case 13:
|
|
196
|
+
putAddress = _context2.t0;
|
|
181
197
|
if ((0, _object.object_isEmpty)(deltaObject)) {
|
|
182
|
-
_context2.next =
|
|
198
|
+
_context2.next = 27;
|
|
183
199
|
break;
|
|
184
200
|
}
|
|
185
201
|
canSaveResult = this.canSave(deltaObject);
|
|
186
202
|
if (!(canSaveResult !== true)) {
|
|
187
|
-
_context2.next =
|
|
203
|
+
_context2.next = 20;
|
|
188
204
|
break;
|
|
189
205
|
}
|
|
190
206
|
WebObject.addError(this, "Save not allowed", String(canSaveResult), true);
|
|
191
207
|
this.setSaveResult(false, "canceled");
|
|
192
208
|
return _context2.abrupt("return", false);
|
|
193
|
-
case
|
|
194
|
-
_context2.next =
|
|
209
|
+
case 20:
|
|
210
|
+
_context2.next = 22;
|
|
195
211
|
return _global.gfunc.run_action(putAction, putAddress, deltaObject);
|
|
196
|
-
case
|
|
212
|
+
case 22:
|
|
197
213
|
resultObject = _context2.sent;
|
|
198
214
|
this.setSaveResult(resultObject, "auto");
|
|
199
215
|
if (!this.__saveResultIsSuccess) {
|
|
200
216
|
console.error("bad save result : ", resultObject);
|
|
201
217
|
WebObject.addError(this, "Save result is not valid", "the response from server was not a valid saveresult object !", true);
|
|
202
218
|
}
|
|
203
|
-
_context2.next =
|
|
219
|
+
_context2.next = 28;
|
|
204
220
|
break;
|
|
205
|
-
case
|
|
221
|
+
case 27:
|
|
206
222
|
/* nothing to save */
|
|
207
223
|
this.setSaveResult(null, "nothing");
|
|
208
|
-
case
|
|
224
|
+
case 28:
|
|
209
225
|
if (!this.isSaved) {
|
|
210
|
-
_context2.next =
|
|
226
|
+
_context2.next = 32;
|
|
211
227
|
break;
|
|
212
228
|
}
|
|
213
|
-
_context2.next =
|
|
229
|
+
_context2.next = 31;
|
|
214
230
|
return this.onSave();
|
|
215
|
-
case
|
|
231
|
+
case 31:
|
|
216
232
|
return _context2.abrupt("return", this.getSaveResult());
|
|
217
|
-
case
|
|
233
|
+
case 32:
|
|
218
234
|
case "end":
|
|
219
235
|
return _context2.stop();
|
|
220
236
|
}
|
|
@@ -229,7 +245,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
229
245
|
key: "Delete",
|
|
230
246
|
value: function () {
|
|
231
247
|
var _Delete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
232
|
-
var resultObject;
|
|
248
|
+
var usepath, resultObject;
|
|
233
249
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
234
250
|
while (1) switch (_context3.prev = _context3.next) {
|
|
235
251
|
case 0:
|
|
@@ -240,15 +256,19 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
240
256
|
return _context3.abrupt("return");
|
|
241
257
|
case 2:
|
|
242
258
|
_context3.next = 4;
|
|
243
|
-
return _global.
|
|
259
|
+
return _global.gfilter.apply_filter("".concat(this.get_webname(), "/path/delete"), "".concat(this.get_webname(), "/").concat(this.getID()));
|
|
244
260
|
case 4:
|
|
261
|
+
usepath = _context3.sent;
|
|
262
|
+
_context3.next = 7;
|
|
263
|
+
return _global.gfunc.run_action("delete", usepath);
|
|
264
|
+
case 7:
|
|
245
265
|
resultObject = _context3.sent;
|
|
246
266
|
this.setSaveResult(resultObject, "auto", true);
|
|
247
|
-
_context3.next =
|
|
267
|
+
_context3.next = 11;
|
|
248
268
|
return this.onDelete();
|
|
249
|
-
case
|
|
269
|
+
case 11:
|
|
250
270
|
return _context3.abrupt("return", resultObject);
|
|
251
|
-
case
|
|
271
|
+
case 12:
|
|
252
272
|
case "end":
|
|
253
273
|
return _context3.stop();
|
|
254
274
|
}
|
|
@@ -263,7 +283,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
263
283
|
key: "Lock",
|
|
264
284
|
value: function () {
|
|
265
285
|
var _Lock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
266
|
-
var resultObject;
|
|
286
|
+
var usepath, resultObject;
|
|
267
287
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
268
288
|
while (1) switch (_context4.prev = _context4.next) {
|
|
269
289
|
case 0:
|
|
@@ -274,15 +294,19 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
274
294
|
return _context4.abrupt("return");
|
|
275
295
|
case 2:
|
|
276
296
|
_context4.next = 4;
|
|
277
|
-
return _global.
|
|
297
|
+
return _global.gfilter.apply_filter("".concat(this.get_webname(), "/path/lock"), "".concat(this.get_webname(), "/").concat(this.getID(), "/lock"));
|
|
278
298
|
case 4:
|
|
299
|
+
usepath = _context4.sent;
|
|
300
|
+
_context4.next = 7;
|
|
301
|
+
return _global.gfunc.run_action("post", usepath);
|
|
302
|
+
case 7:
|
|
279
303
|
resultObject = _context4.sent;
|
|
280
304
|
this.setSaveResult(resultObject, "auto", true);
|
|
281
|
-
_context4.next =
|
|
305
|
+
_context4.next = 11;
|
|
282
306
|
return this.onLock();
|
|
283
|
-
case
|
|
307
|
+
case 11:
|
|
284
308
|
return _context4.abrupt("return", resultObject);
|
|
285
|
-
case
|
|
309
|
+
case 12:
|
|
286
310
|
case "end":
|
|
287
311
|
return _context4.stop();
|
|
288
312
|
}
|
|
@@ -297,7 +321,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
297
321
|
key: "UnLock",
|
|
298
322
|
value: function () {
|
|
299
323
|
var _UnLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
300
|
-
var resultObject;
|
|
324
|
+
var usepath, resultObject;
|
|
301
325
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
302
326
|
while (1) switch (_context5.prev = _context5.next) {
|
|
303
327
|
case 0:
|
|
@@ -308,15 +332,19 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
308
332
|
return _context5.abrupt("return");
|
|
309
333
|
case 2:
|
|
310
334
|
_context5.next = 4;
|
|
311
|
-
return _global.
|
|
335
|
+
return _global.gfilter.apply_filter("".concat(this.get_webname(), "/path/unlock"), "".concat(this.get_webname(), "/").concat(this.getID(), "/unlock"));
|
|
312
336
|
case 4:
|
|
337
|
+
usepath = _context5.sent;
|
|
338
|
+
_context5.next = 7;
|
|
339
|
+
return _global.gfunc.run_action("post", usepath);
|
|
340
|
+
case 7:
|
|
313
341
|
resultObject = _context5.sent;
|
|
314
342
|
this.setSaveResult(resultObject, "auto", true);
|
|
315
|
-
_context5.next =
|
|
343
|
+
_context5.next = 11;
|
|
316
344
|
return this.onUnLock();
|
|
317
|
-
case
|
|
345
|
+
case 11:
|
|
318
346
|
return _context5.abrupt("return", resultObject);
|
|
319
|
-
case
|
|
347
|
+
case 12:
|
|
320
348
|
case "end":
|
|
321
349
|
return _context5.stop();
|
|
322
350
|
}
|
|
@@ -331,7 +359,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
331
359
|
key: "Archive",
|
|
332
360
|
value: function () {
|
|
333
361
|
var _Archive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
334
|
-
var resultObject;
|
|
362
|
+
var usepath, resultObject;
|
|
335
363
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
336
364
|
while (1) switch (_context6.prev = _context6.next) {
|
|
337
365
|
case 0:
|
|
@@ -342,15 +370,19 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
342
370
|
return _context6.abrupt("return");
|
|
343
371
|
case 2:
|
|
344
372
|
_context6.next = 4;
|
|
345
|
-
return _global.
|
|
373
|
+
return _global.gfilter.apply_filter("".concat(this.get_webname(), "/path/archive"), "".concat(this.get_webname(), "/").concat(this.getID(), "/archive"));
|
|
346
374
|
case 4:
|
|
375
|
+
usepath = _context6.sent;
|
|
376
|
+
_context6.next = 7;
|
|
377
|
+
return _global.gfunc.run_action("post", usepath);
|
|
378
|
+
case 7:
|
|
347
379
|
resultObject = _context6.sent;
|
|
348
380
|
this.setSaveResult(resultObject, "auto", true);
|
|
349
|
-
_context6.next =
|
|
381
|
+
_context6.next = 11;
|
|
350
382
|
return this.onArchive();
|
|
351
|
-
case
|
|
383
|
+
case 11:
|
|
352
384
|
return _context6.abrupt("return", resultObject);
|
|
353
|
-
case
|
|
385
|
+
case 12:
|
|
354
386
|
case "end":
|
|
355
387
|
return _context6.stop();
|
|
356
388
|
}
|
|
@@ -365,7 +397,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
365
397
|
key: "UnArchive",
|
|
366
398
|
value: function () {
|
|
367
399
|
var _UnArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
368
|
-
var resultObject;
|
|
400
|
+
var usepath, resultObject;
|
|
369
401
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
370
402
|
while (1) switch (_context7.prev = _context7.next) {
|
|
371
403
|
case 0:
|
|
@@ -376,15 +408,18 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
376
408
|
return _context7.abrupt("return");
|
|
377
409
|
case 2:
|
|
378
410
|
_context7.next = 4;
|
|
379
|
-
return _global.
|
|
411
|
+
return _global.gfilter.apply_filter("".concat(this.get_webname(), "/path/unarchive"), "".concat(this.get_webname(), "/").concat(this.getID(), "/unarchive"));
|
|
380
412
|
case 4:
|
|
413
|
+
usepath = _context7.sent;
|
|
414
|
+
_context7.next = 7;
|
|
415
|
+
return _global.gfunc.run_action("post", usepath);
|
|
416
|
+
case 7:
|
|
381
417
|
resultObject = _context7.sent;
|
|
382
|
-
|
|
383
|
-
_context7.next = 8;
|
|
418
|
+
_context7.next = 10;
|
|
384
419
|
return this.onUnArchive();
|
|
385
|
-
case
|
|
420
|
+
case 10:
|
|
386
421
|
return _context7.abrupt("return", resultObject);
|
|
387
|
-
case
|
|
422
|
+
case 11:
|
|
388
423
|
case "end":
|
|
389
424
|
return _context7.stop();
|
|
390
425
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azrico/webobject",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.138",
|
|
4
4
|
"description": "Stateful object",
|
|
5
5
|
"author": "Azrideus",
|
|
6
6
|
"license": "MIT",
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@azrico/convert": "^1.0.5",
|
|
73
|
-
"@azrico/event": "^1.2.
|
|
74
|
-
"@azrico/global": "^1.3.
|
|
73
|
+
"@azrico/event": "^1.2.34",
|
|
74
|
+
"@azrico/global": "^1.3.76",
|
|
75
75
|
"@azrico/math": "^1.0.5",
|
|
76
76
|
"@azrico/object": "^1.4.101",
|
|
77
|
-
"@azrico/string": "^1.2.
|
|
78
|
-
"@azrico/types": "^1.0.
|
|
77
|
+
"@azrico/string": "^1.2.95",
|
|
78
|
+
"@azrico/types": "^1.0.9",
|
|
79
79
|
"@azrico/uid": "^1.0.8"
|
|
80
80
|
},
|
|
81
81
|
"packageManager": "yarn@3.5.0"
|