@azrico/webobject 1.4.138 → 1.4.139
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 +24 -36
- package/dist/src/WebObjects/WebObjectPathHelper.d.ts +28 -0
- package/dist/src/WebObjects/WebObjectPathHelper.js +138 -0
- package/dist/src/WebObjects/WebObjectPathHelper.test.d.ts +1 -0
- package/dist/src/WebObjects/WebObjectPathHelper.test.js +101 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ var _object = require("@azrico/object");
|
|
|
9
9
|
var _string = require("@azrico/string");
|
|
10
10
|
var _global = require("@azrico/global");
|
|
11
11
|
var _convert = _interopRequireDefault(require("@azrico/convert"));
|
|
12
|
+
var _WebObjectPathHelper = _interopRequireDefault(require("./WebObjectPathHelper"));
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
14
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
15
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
@@ -168,7 +169,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
168
169
|
key: "Save",
|
|
169
170
|
value: function () {
|
|
170
171
|
var _Save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
171
|
-
var deltaObject, putAction,
|
|
172
|
+
var deltaObject, putAction, usepath, canSaveResult, resultObject;
|
|
172
173
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
173
174
|
while (1) switch (_context2.prev = _context2.next) {
|
|
174
175
|
case 0:
|
|
@@ -177,60 +178,47 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
177
178
|
case 2:
|
|
178
179
|
deltaObject = _context2.sent;
|
|
179
180
|
putAction = "post";
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
+
_context2.next = 6;
|
|
182
|
+
return _WebObjectPathHelper["default"].get_path(this, this.isNew ? "new" : "save");
|
|
183
|
+
case 6:
|
|
184
|
+
usepath = _context2.sent;
|
|
197
185
|
if ((0, _object.object_isEmpty)(deltaObject)) {
|
|
198
|
-
_context2.next =
|
|
186
|
+
_context2.next = 20;
|
|
199
187
|
break;
|
|
200
188
|
}
|
|
201
189
|
canSaveResult = this.canSave(deltaObject);
|
|
202
190
|
if (!(canSaveResult !== true)) {
|
|
203
|
-
_context2.next =
|
|
191
|
+
_context2.next = 13;
|
|
204
192
|
break;
|
|
205
193
|
}
|
|
206
194
|
WebObject.addError(this, "Save not allowed", String(canSaveResult), true);
|
|
207
195
|
this.setSaveResult(false, "canceled");
|
|
208
196
|
return _context2.abrupt("return", false);
|
|
209
|
-
case
|
|
210
|
-
_context2.next =
|
|
211
|
-
return _global.gfunc.run_action(putAction,
|
|
212
|
-
case
|
|
197
|
+
case 13:
|
|
198
|
+
_context2.next = 15;
|
|
199
|
+
return _global.gfunc.run_action(putAction, usepath, deltaObject);
|
|
200
|
+
case 15:
|
|
213
201
|
resultObject = _context2.sent;
|
|
214
202
|
this.setSaveResult(resultObject, "auto");
|
|
215
203
|
if (!this.__saveResultIsSuccess) {
|
|
216
204
|
console.error("bad save result : ", resultObject);
|
|
217
205
|
WebObject.addError(this, "Save result is not valid", "the response from server was not a valid saveresult object !", true);
|
|
218
206
|
}
|
|
219
|
-
_context2.next =
|
|
207
|
+
_context2.next = 21;
|
|
220
208
|
break;
|
|
221
|
-
case
|
|
209
|
+
case 20:
|
|
222
210
|
/* nothing to save */
|
|
223
211
|
this.setSaveResult(null, "nothing");
|
|
224
|
-
case
|
|
212
|
+
case 21:
|
|
225
213
|
if (!this.isSaved) {
|
|
226
|
-
_context2.next =
|
|
214
|
+
_context2.next = 25;
|
|
227
215
|
break;
|
|
228
216
|
}
|
|
229
|
-
_context2.next =
|
|
217
|
+
_context2.next = 24;
|
|
230
218
|
return this.onSave();
|
|
231
|
-
case
|
|
219
|
+
case 24:
|
|
232
220
|
return _context2.abrupt("return", this.getSaveResult());
|
|
233
|
-
case
|
|
221
|
+
case 25:
|
|
234
222
|
case "end":
|
|
235
223
|
return _context2.stop();
|
|
236
224
|
}
|
|
@@ -256,7 +244,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
256
244
|
return _context3.abrupt("return");
|
|
257
245
|
case 2:
|
|
258
246
|
_context3.next = 4;
|
|
259
|
-
return
|
|
247
|
+
return _WebObjectPathHelper["default"].get_path(this, "delete");
|
|
260
248
|
case 4:
|
|
261
249
|
usepath = _context3.sent;
|
|
262
250
|
_context3.next = 7;
|
|
@@ -294,7 +282,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
294
282
|
return _context4.abrupt("return");
|
|
295
283
|
case 2:
|
|
296
284
|
_context4.next = 4;
|
|
297
|
-
return
|
|
285
|
+
return _WebObjectPathHelper["default"].get_path(this, "lock");
|
|
298
286
|
case 4:
|
|
299
287
|
usepath = _context4.sent;
|
|
300
288
|
_context4.next = 7;
|
|
@@ -332,7 +320,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
332
320
|
return _context5.abrupt("return");
|
|
333
321
|
case 2:
|
|
334
322
|
_context5.next = 4;
|
|
335
|
-
return
|
|
323
|
+
return _WebObjectPathHelper["default"].get_path(this, "unlock");
|
|
336
324
|
case 4:
|
|
337
325
|
usepath = _context5.sent;
|
|
338
326
|
_context5.next = 7;
|
|
@@ -370,7 +358,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
370
358
|
return _context6.abrupt("return");
|
|
371
359
|
case 2:
|
|
372
360
|
_context6.next = 4;
|
|
373
|
-
return
|
|
361
|
+
return _WebObjectPathHelper["default"].get_path(this, "archive");
|
|
374
362
|
case 4:
|
|
375
363
|
usepath = _context6.sent;
|
|
376
364
|
_context6.next = 7;
|
|
@@ -408,7 +396,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
408
396
|
return _context7.abrupt("return");
|
|
409
397
|
case 2:
|
|
410
398
|
_context7.next = 4;
|
|
411
|
-
return
|
|
399
|
+
return _WebObjectPathHelper["default"].get_path(this, "unarchive");
|
|
412
400
|
case 4:
|
|
413
401
|
usepath = _context7.sent;
|
|
414
402
|
_context7.next = 7;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ClassType } from "@azrico/types";
|
|
2
|
+
import WebObject from "./WebObject";
|
|
3
|
+
export declare class WebObjectPathHelper {
|
|
4
|
+
static readonly defaultPaths: {
|
|
5
|
+
lock: string;
|
|
6
|
+
unlock: string;
|
|
7
|
+
archive: string;
|
|
8
|
+
unarchive: string;
|
|
9
|
+
delete: string;
|
|
10
|
+
new: string;
|
|
11
|
+
save: string;
|
|
12
|
+
};
|
|
13
|
+
static readonly pathOverrides: {};
|
|
14
|
+
static get_path(obj: WebObject, pn: string): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* clear all paths that are override by `override_path`
|
|
17
|
+
*/
|
|
18
|
+
static clear_overrides(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* override a save path for the gievn webobject
|
|
21
|
+
* @param obj
|
|
22
|
+
* @param pn
|
|
23
|
+
* @param override
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
static override_path(obj: ClassType<WebObject> | string, pn: string, override: string): Promise<string | false>;
|
|
27
|
+
}
|
|
28
|
+
export default WebObjectPathHelper;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.WebObjectPathHelper = void 0;
|
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
var WebObjectPathHelper = exports.WebObjectPathHelper = /*#__PURE__*/function () {
|
|
18
|
+
function WebObjectPathHelper() {
|
|
19
|
+
_classCallCheck(this, WebObjectPathHelper);
|
|
20
|
+
}
|
|
21
|
+
_createClass(WebObjectPathHelper, null, [{
|
|
22
|
+
key: "get_path",
|
|
23
|
+
value: function () {
|
|
24
|
+
var _get_path = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(obj, pn) {
|
|
25
|
+
var wn, usepath;
|
|
26
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
27
|
+
while (1) switch (_context.prev = _context.next) {
|
|
28
|
+
case 0:
|
|
29
|
+
pn = String(pn).toLowerCase();
|
|
30
|
+
wn = obj.get_webname();
|
|
31
|
+
usepath = "";
|
|
32
|
+
if (WebObjectPathHelper.pathOverrides[wn] && WebObjectPathHelper.pathOverrides[wn][pn]) {
|
|
33
|
+
usepath = WebObjectPathHelper.pathOverrides[wn][pn];
|
|
34
|
+
} else {
|
|
35
|
+
usepath = WebObjectPathHelper.defaultPaths[pn];
|
|
36
|
+
}
|
|
37
|
+
if (!usepath) usepath = WebObjectPathHelper.defaultPaths["save"];
|
|
38
|
+
usepath = usepath.replaceAll("{wn}", obj.get_webname());
|
|
39
|
+
usepath = usepath.replaceAll("{wp}", obj.__web_path);
|
|
40
|
+
usepath = usepath.replaceAll("{id}", obj.getID());
|
|
41
|
+
return _context.abrupt("return", usepath);
|
|
42
|
+
case 9:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
45
|
+
}
|
|
46
|
+
}, _callee);
|
|
47
|
+
}));
|
|
48
|
+
function get_path(_x, _x2) {
|
|
49
|
+
return _get_path.apply(this, arguments);
|
|
50
|
+
}
|
|
51
|
+
return get_path;
|
|
52
|
+
}()
|
|
53
|
+
/**
|
|
54
|
+
* clear all paths that are override by `override_path`
|
|
55
|
+
*/
|
|
56
|
+
}, {
|
|
57
|
+
key: "clear_overrides",
|
|
58
|
+
value: (function () {
|
|
59
|
+
var _clear_overrides = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
60
|
+
var key;
|
|
61
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
62
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
63
|
+
case 0:
|
|
64
|
+
for (key in this.pathOverrides) {
|
|
65
|
+
this.pathOverrides[key] = {};
|
|
66
|
+
}
|
|
67
|
+
case 1:
|
|
68
|
+
case "end":
|
|
69
|
+
return _context2.stop();
|
|
70
|
+
}
|
|
71
|
+
}, _callee2, this);
|
|
72
|
+
}));
|
|
73
|
+
function clear_overrides() {
|
|
74
|
+
return _clear_overrides.apply(this, arguments);
|
|
75
|
+
}
|
|
76
|
+
return clear_overrides;
|
|
77
|
+
}()
|
|
78
|
+
/**
|
|
79
|
+
* override a save path for the gievn webobject
|
|
80
|
+
* @param obj
|
|
81
|
+
* @param pn
|
|
82
|
+
* @param override
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
85
|
+
)
|
|
86
|
+
}, {
|
|
87
|
+
key: "override_path",
|
|
88
|
+
value: (function () {
|
|
89
|
+
var _override_path = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(obj, pn, override) {
|
|
90
|
+
var wn;
|
|
91
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
92
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
pn = String(pn).toLowerCase();
|
|
95
|
+
wn = "";
|
|
96
|
+
if (typeof obj === "string") {
|
|
97
|
+
wn = obj;
|
|
98
|
+
} else if (typeof obj.get_webname === "function") {
|
|
99
|
+
wn = obj.get_webname();
|
|
100
|
+
} else {
|
|
101
|
+
console.error("[override_path]", "given object has no get_webname");
|
|
102
|
+
wn = obj.__web_path || obj.__web_type;
|
|
103
|
+
}
|
|
104
|
+
if (wn) {
|
|
105
|
+
_context3.next = 6;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
console.error("[override_path]", "bad webname");
|
|
109
|
+
return _context3.abrupt("return", false);
|
|
110
|
+
case 6:
|
|
111
|
+
if (!WebObjectPathHelper.pathOverrides[wn]) WebObjectPathHelper.pathOverrides[wn] = {};
|
|
112
|
+
WebObjectPathHelper.pathOverrides[wn][pn] = override;
|
|
113
|
+
return _context3.abrupt("return", override);
|
|
114
|
+
case 9:
|
|
115
|
+
case "end":
|
|
116
|
+
return _context3.stop();
|
|
117
|
+
}
|
|
118
|
+
}, _callee3);
|
|
119
|
+
}));
|
|
120
|
+
function override_path(_x3, _x4, _x5) {
|
|
121
|
+
return _override_path.apply(this, arguments);
|
|
122
|
+
}
|
|
123
|
+
return override_path;
|
|
124
|
+
}())
|
|
125
|
+
}]);
|
|
126
|
+
return WebObjectPathHelper;
|
|
127
|
+
}();
|
|
128
|
+
_defineProperty(WebObjectPathHelper, "defaultPaths", {
|
|
129
|
+
lock: "{wn}/{id}/lock",
|
|
130
|
+
unlock: "{wn}/{id}/unlock",
|
|
131
|
+
archive: "{wn}/{id}/archive",
|
|
132
|
+
unarchive: "{wn}/{id}/unarchive",
|
|
133
|
+
"delete": "{wn}/{id}",
|
|
134
|
+
"new": "{wn}",
|
|
135
|
+
save: "{wn}/{id}"
|
|
136
|
+
});
|
|
137
|
+
_defineProperty(WebObjectPathHelper, "pathOverrides", {});
|
|
138
|
+
var _default = exports["default"] = WebObjectPathHelper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _index = require("../index");
|
|
4
|
+
var _WebObjectPathHelper = _interopRequireDefault(require("./WebObjectPathHelper"));
|
|
5
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
6
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
7
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
15
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
18
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
19
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
+
var TestWebObject = /*#__PURE__*/function (_WebObject) {
|
|
24
|
+
_inherits(TestWebObject, _WebObject);
|
|
25
|
+
function TestWebObject() {
|
|
26
|
+
_classCallCheck(this, TestWebObject);
|
|
27
|
+
return _callSuper(this, TestWebObject, arguments);
|
|
28
|
+
}
|
|
29
|
+
return _createClass(TestWebObject);
|
|
30
|
+
}(_index.WebObject);
|
|
31
|
+
_defineProperty(TestWebObject, "__web_path", "test-wp");
|
|
32
|
+
describe("WebObjectPathHelper", function () {
|
|
33
|
+
var wobj;
|
|
34
|
+
beforeEach(function () {
|
|
35
|
+
_WebObjectPathHelper["default"].clear_overrides();
|
|
36
|
+
wobj = new TestWebObject();
|
|
37
|
+
wobj._id = "test";
|
|
38
|
+
});
|
|
39
|
+
it("get_path", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
40
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
_context.t0 = expect;
|
|
44
|
+
_context.next = 3;
|
|
45
|
+
return _WebObjectPathHelper["default"].get_path(wobj, "save");
|
|
46
|
+
case 3:
|
|
47
|
+
_context.t1 = _context.sent;
|
|
48
|
+
(0, _context.t0)(_context.t1).toBe(wobj.get_webname() + "/" + wobj.getID());
|
|
49
|
+
_context.t2 = expect;
|
|
50
|
+
_context.next = 8;
|
|
51
|
+
return _WebObjectPathHelper["default"].get_path(wobj, "new");
|
|
52
|
+
case 8:
|
|
53
|
+
_context.t3 = _context.sent;
|
|
54
|
+
(0, _context.t2)(_context.t3).toBe(wobj.get_webname());
|
|
55
|
+
_context.t4 = expect;
|
|
56
|
+
_context.next = 13;
|
|
57
|
+
return _WebObjectPathHelper["default"].get_path(wobj, "lock");
|
|
58
|
+
case 13:
|
|
59
|
+
_context.t5 = _context.sent;
|
|
60
|
+
(0, _context.t4)(_context.t5).toBe("".concat(wobj.get_webname(), "/").concat(wobj.getID(), "/lock"));
|
|
61
|
+
case 15:
|
|
62
|
+
case "end":
|
|
63
|
+
return _context.stop();
|
|
64
|
+
}
|
|
65
|
+
}, _callee);
|
|
66
|
+
})));
|
|
67
|
+
it("override_path", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
68
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
69
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
70
|
+
case 0:
|
|
71
|
+
_context2.next = 2;
|
|
72
|
+
return _WebObjectPathHelper["default"].override_path(wobj.get_webname(), "save", "blah");
|
|
73
|
+
case 2:
|
|
74
|
+
_context2.t0 = expect;
|
|
75
|
+
_context2.next = 5;
|
|
76
|
+
return _WebObjectPathHelper["default"].get_path(wobj, "save");
|
|
77
|
+
case 5:
|
|
78
|
+
_context2.t1 = _context2.sent;
|
|
79
|
+
(0, _context2.t0)(_context2.t1).toBe("blah");
|
|
80
|
+
_context2.next = 9;
|
|
81
|
+
return _WebObjectPathHelper["default"].override_path(wobj.get_webname(), "save", "{id}");
|
|
82
|
+
case 9:
|
|
83
|
+
_context2.t2 = expect;
|
|
84
|
+
_context2.next = 12;
|
|
85
|
+
return _WebObjectPathHelper["default"].get_path(wobj, "save");
|
|
86
|
+
case 12:
|
|
87
|
+
_context2.t3 = _context2.sent;
|
|
88
|
+
(0, _context2.t2)(_context2.t3).toBe(wobj.getID());
|
|
89
|
+
_context2.t4 = expect;
|
|
90
|
+
_context2.next = 17;
|
|
91
|
+
return _WebObjectPathHelper["default"].get_path(wobj, "new");
|
|
92
|
+
case 17:
|
|
93
|
+
_context2.t5 = _context2.sent;
|
|
94
|
+
(0, _context2.t4)(_context2.t5).toBe(wobj.get_webname());
|
|
95
|
+
case 19:
|
|
96
|
+
case "end":
|
|
97
|
+
return _context2.stop();
|
|
98
|
+
}
|
|
99
|
+
}, _callee2);
|
|
100
|
+
})));
|
|
101
|
+
});
|