|
18 | 18 | Path = require("./Path"); |
19 | 19 |
|
20 | 20 | module.exports = Node = (function(_super) { |
| 21 | + var _this = this; |
21 | 22 |
|
22 | 23 | __extends(Node, _super); |
23 | 24 |
|
|
33 | 34 |
|
34 | 35 |
|
35 | 36 |
|
36 | | - Node.prototype.save = function Node_prototype_save__1(_) { var message, response, services, _ref, _ref1, __this = this; var __frame = { name: "Node_prototype_save__1", line: 36 }; return __func(_, this, arguments, Node_prototype_save__1, 0, __frame, function __$Node_prototype_save__1() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$Node_prototype_save__1() { return (function __$Node_prototype_save__1(__then) { |
| 37 | + Node.prototype.save = function Node_prototype_save__1(_) { var message, response, services, _ref, _ref1, __this = this; var __frame = { name: "Node_prototype_save__1", line: 37 }; return __func(_, this, arguments, Node_prototype_save__1, 0, __frame, function __$Node_prototype_save__1() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$Node_prototype_save__1() { return (function __$Node_prototype_save__1(__then) { |
37 | 38 |
|
38 | 39 |
|
39 | 40 | if (__this.exists) { |
|
70 | 71 |
|
71 | 72 |
|
72 | 73 |
|
73 | | - Node.prototype["delete"] = function Node_prototype_delete__2(_, force) { var relationship, relationships, __this = this, __arguments = arguments; var __frame = { name: "Node_prototype_delete__2", line: 73 }; return __func(_, this, arguments, Node_prototype_delete__2, 0, __frame, function __$Node_prototype_delete__2() { |
| 74 | + Node.prototype["delete"] = function Node_prototype_delete__2(_, force) { var relationship, relationships, __this = this, __arguments = arguments; var __frame = { name: "Node_prototype_delete__2", line: 74 }; return __func(_, this, arguments, Node_prototype_delete__2, 0, __frame, function __$Node_prototype_delete__2() { |
74 | 75 |
|
75 | 76 | if ((force == null)) { |
76 | 77 | force = false; } ; |
|
97 | 98 | return __apply(__cb(_, __frame, 24, 13, _, true), Node.__super__["delete"], __this, __arguments, 0); }); }); }); }; |
98 | 99 |
|
99 | 100 |
|
100 | | - Node.prototype.index = function Node_prototype_index__3(index, key, value, _) { var encodedKey, encodedValue, response, services, url, version, __this = this; var __frame = { name: "Node_prototype_index__3", line: 100 }; return __func(_, this, arguments, Node_prototype_index__3, 3, __frame, function __$Node_prototype_index__3() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$Node_prototype_index__3() { |
| 101 | + Node.prototype.index = function Node_prototype_index__3(index, key, value, _) { var encodedKey, encodedValue, response, services, url, version, __this = this; var __frame = { name: "Node_prototype_index__3", line: 101 }; return __func(_, this, arguments, Node_prototype_index__3, 3, __frame, function __$Node_prototype_index__3() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$Node_prototype_index__3() { |
101 | 102 |
|
102 | 103 |
|
103 | 104 | if (!__this.exists) { |
|
131 | 132 |
|
132 | 133 |
|
133 | 134 |
|
134 | | - Node.prototype.unindex = function Node_prototype_unindex__4(index, _) { var response, services, url, __this = this; var __frame = { name: "Node_prototype_unindex__4", line: 134 }; return __func(_, this, arguments, Node_prototype_unindex__4, 1, __frame, function __$Node_prototype_unindex__4() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$Node_prototype_unindex__4() { |
| 135 | + Node.prototype.unindex = function Node_prototype_unindex__4(index, key, value, _) { var encodedKey, encodedValue, response, services, url, __this = this; var __frame = { name: "Node_prototype_unindex__4", line: 135 }; return __func(_, this, arguments, Node_prototype_unindex__4, 3, __frame, function __$Node_prototype_unindex__4() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$Node_prototype_unindex__4() { |
135 | 136 |
|
136 | 137 |
|
137 | 138 | if (!__this.exists) { |
138 | 139 | return _(new Error("Node must exists before unindexing properties")); } ; |
139 | 140 |
|
140 | 141 | return __this.db.getServices(__cb(_, __frame, 6, 19, function ___(__0, __1) { services = __1; |
141 | | - url = ((((("" + services.node_index) + "/") + index) + "/") + __this.id); |
142 | | - console.log("unindex"); |
143 | | - console.log(status.NO_CONTENT); |
144 | | - console.log(url); |
145 | | - console.log(__this.self); |
146 | | - return __this._request.del(url, __cb(_, __frame, 12, 19, function ___(__0, __2) { response = __2; |
| 142 | + if (key) { |
| 143 | + encodedKey = encodeURIComponent(key); |
| 144 | + if (value) { |
| 145 | + encodedValue = encodeURIComponent(value); |
| 146 | + url = ((((((((("" + services.node_index) + "/") + index) + "/") + encodedKey) + "/") + encodedValue) + "/") + __this.id); } |
| 147 | + else { |
| 148 | + url = ((((((("" + services.node_index) + "/") + index) + "/") + encodedKey) + "/") + __this.id); } ; } |
| 149 | + |
| 150 | + else { |
| 151 | + url = ((((("" + services.node_index) + "/") + index) + "/") + __this.id); } ; |
| 152 | + |
| 153 | + return __this._request.del(url, __cb(_, __frame, 18, 19, function ___(__0, __2) { response = __2; |
147 | 154 | if ((response.statusCode !== status.NO_CONTENT)) { |
148 | 155 | return _(response); } ; __then(); }, true)); }, true)); }); })(function ___(error, __result) { __tryCatch(_, function __$Node_prototype_unindex__4() { if (error) { |
149 | 156 |
|
|
152 | 159 |
|
153 | 160 |
|
154 | 161 |
|
155 | | - Node.prototype.createRelationshipTo = function Node_prototype_createRelationshipTo__5(otherNode, type, data, _) { var __this = this; var __frame = { name: "Node_prototype_createRelationshipTo__5", line: 155 }; return __func(_, this, arguments, Node_prototype_createRelationshipTo__5, 3, __frame, function __$Node_prototype_createRelationshipTo__5() { |
| 162 | + (function(actual) { |
| 163 | + return Node.prototype.unindex = function(index, key, value, callback) { |
| 164 | + if ((typeof key === "function")) { |
| 165 | + callback = key; |
| 166 | + key = null; |
| 167 | + value = null; } |
| 168 | + else if ((typeof value === "function")) { |
| 169 | + callback = value; |
| 170 | + value = null; } ; |
| 171 | + |
| 172 | + return actual.call(this, index, key, value, callback); }; |
| 173 | + |
| 174 | + })(Node.prototype.unindex); |
| 175 | + |
| 176 | + Node.prototype.createRelationshipTo = function Node_prototype_createRelationshipTo__5(otherNode, type, data, _) { var __this = this; var __frame = { name: "Node_prototype_createRelationshipTo__5", line: 176 }; return __func(_, this, arguments, Node_prototype_createRelationshipTo__5, 3, __frame, function __$Node_prototype_createRelationshipTo__5() { |
156 | 177 | return __this._createRelationship(__this, otherNode, type, data, __cb(_, __frame, 1, 13, _, true)); }); }; |
157 | 178 |
|
158 | 179 |
|
159 | | - Node.prototype.createRelationshipFrom = function Node_prototype_createRelationshipFrom__6(otherNode, type, data, _) { var __this = this; var __frame = { name: "Node_prototype_createRelationshipFrom__6", line: 159 }; return __func(_, this, arguments, Node_prototype_createRelationshipFrom__6, 3, __frame, function __$Node_prototype_createRelationshipFrom__6() { |
| 180 | + Node.prototype.createRelationshipFrom = function Node_prototype_createRelationshipFrom__6(otherNode, type, data, _) { var __this = this; var __frame = { name: "Node_prototype_createRelationshipFrom__6", line: 180 }; return __func(_, this, arguments, Node_prototype_createRelationshipFrom__6, 3, __frame, function __$Node_prototype_createRelationshipFrom__6() { |
160 | 181 | return __this._createRelationship(otherNode, __this, type, data, __cb(_, __frame, 1, 13, _, true)); }); }; |
161 | 182 |
|
162 | 183 |
|
163 | | - Node.prototype._createRelationship = function Node_prototype__createRelationship__7(from, to, type, data, _) { var createRelationshipURL, message, otherNodeURL, response, _ref, _ref1, __this = this; var __frame = { name: "Node_prototype__createRelationship__7", line: 163 }; return __func(_, this, arguments, Node_prototype__createRelationship__7, 4, __frame, function __$Node_prototype__createRelationship__7() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$Node_prototype__createRelationship__7() { |
| 184 | + Node.prototype._createRelationship = function Node_prototype__createRelationship__7(from, to, type, data, _) { var createRelationshipURL, message, otherNodeURL, response, _ref, _ref1, __this = this; var __frame = { name: "Node_prototype__createRelationship__7", line: 184 }; return __func(_, this, arguments, Node_prototype__createRelationship__7, 4, __frame, function __$Node_prototype__createRelationship__7() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$Node_prototype__createRelationship__7() { |
164 | 185 |
|
165 | 186 |
|
166 | 187 | createRelationshipURL = from._data["create_relationship"]; |
|
194 | 215 |
|
195 | 216 |
|
196 | 217 |
|
197 | | - Node.prototype._getRelationships = function Node_prototype__getRelationships__8(direction, type, _) { var prefix, relationshipsURL, resp, types, _this, __this = this; var __frame = { name: "Node_prototype__getRelationships__8", line: 197 }; return __func(_, this, arguments, Node_prototype__getRelationships__8, 2, __frame, function __$Node_prototype__getRelationships__8() { _this = __this; |
| 218 | + Node.prototype._getRelationships = function Node_prototype__getRelationships__8(direction, type, _) { var prefix, relationshipsURL, resp, types, _this, __this = this; var __frame = { name: "Node_prototype__getRelationships__8", line: 218 }; return __func(_, this, arguments, Node_prototype__getRelationships__8, 2, __frame, function __$Node_prototype__getRelationships__8() { _this = __this; |
198 | 219 |
|
199 | 220 |
|
200 | 221 | types = null; |
|
230 | 251 |
|
231 | 252 |
|
232 | 253 |
|
233 | | - Node.prototype.getRelationships = function Node_prototype_getRelationships__9(type, _) { var __this = this; var __frame = { name: "Node_prototype_getRelationships__9", line: 233 }; return __func(_, this, arguments, Node_prototype_getRelationships__9, 1, __frame, function __$Node_prototype_getRelationships__9() { |
| 254 | + Node.prototype.getRelationships = function Node_prototype_getRelationships__9(type, _) { var __this = this; var __frame = { name: "Node_prototype_getRelationships__9", line: 254 }; return __func(_, this, arguments, Node_prototype_getRelationships__9, 1, __frame, function __$Node_prototype_getRelationships__9() { |
234 | 255 | return __this.all(type, __cb(_, __frame, 1, 13, _, true)); }); }; |
235 | 256 |
|
236 | 257 |
|
237 | | - Node.prototype.outgoing = function Node_prototype_outgoing__10(type, _) { var __this = this; var __frame = { name: "Node_prototype_outgoing__10", line: 237 }; return __func(_, this, arguments, Node_prototype_outgoing__10, 1, __frame, function __$Node_prototype_outgoing__10() { |
| 258 | + Node.prototype.outgoing = function Node_prototype_outgoing__10(type, _) { var __this = this; var __frame = { name: "Node_prototype_outgoing__10", line: 258 }; return __func(_, this, arguments, Node_prototype_outgoing__10, 1, __frame, function __$Node_prototype_outgoing__10() { |
238 | 259 | return __this._getRelationships("outgoing", type, __cb(_, __frame, 1, 13, _, true)); }); }; |
239 | 260 |
|
240 | 261 |
|
241 | | - Node.prototype.incoming = function Node_prototype_incoming__11(type, _) { var __this = this; var __frame = { name: "Node_prototype_incoming__11", line: 241 }; return __func(_, this, arguments, Node_prototype_incoming__11, 1, __frame, function __$Node_prototype_incoming__11() { |
| 262 | + Node.prototype.incoming = function Node_prototype_incoming__11(type, _) { var __this = this; var __frame = { name: "Node_prototype_incoming__11", line: 262 }; return __func(_, this, arguments, Node_prototype_incoming__11, 1, __frame, function __$Node_prototype_incoming__11() { |
242 | 263 | return __this._getRelationships("incoming", type, __cb(_, __frame, 1, 13, _, true)); }); }; |
243 | 264 |
|
244 | 265 |
|
245 | | - Node.prototype.all = function Node_prototype_all__12(type, _) { var __this = this; var __frame = { name: "Node_prototype_all__12", line: 245 }; return __func(_, this, arguments, Node_prototype_all__12, 1, __frame, function __$Node_prototype_all__12() { |
| 266 | + Node.prototype.all = function Node_prototype_all__12(type, _) { var __this = this; var __frame = { name: "Node_prototype_all__12", line: 266 }; return __func(_, this, arguments, Node_prototype_all__12, 1, __frame, function __$Node_prototype_all__12() { |
246 | 267 | return __this._getRelationships("all", type, __cb(_, __frame, 1, 13, _, true)); }); }; |
247 | 268 |
|
248 | 269 |
|
249 | | - Node.prototype.getRelationshipNodes = function Node_prototype_getRelationshipNodes__13(rels, _) { var resp, traverseURL, _ref, _ref1, _ref2, _this, __this = this; var __frame = { name: "Node_prototype_getRelationshipNodes__13", line: 249 }; return __func(_, this, arguments, Node_prototype_getRelationshipNodes__13, 1, __frame, function __$Node_prototype_getRelationshipNodes__13() { _this = __this; |
| 270 | + Node.prototype.getRelationshipNodes = function Node_prototype_getRelationshipNodes__13(rels, _) { var resp, traverseURL, _ref, _ref1, _ref2, _this, __this = this; var __frame = { name: "Node_prototype_getRelationshipNodes__13", line: 270 }; return __func(_, this, arguments, Node_prototype_getRelationshipNodes__13, 1, __frame, function __$Node_prototype_getRelationshipNodes__13() { _this = __this; |
250 | 271 |
|
251 | 272 |
|
252 | 273 | rels = ((rels instanceof Array) ? rels : [rels,]); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$Node_prototype_getRelationshipNodes__13() { |
|
284 | 305 |
|
285 | 306 |
|
286 | 307 |
|
287 | | - Node.prototype.path = function Node_prototype_path__14(to, type, direction, maxDepth, algorithm, _) { var data, end, length, nodes, pathURL, relationships, res, start, _this, __this = this; var __frame = { name: "Node_prototype_path__14", line: 287 }; return __func(_, this, arguments, Node_prototype_path__14, 5, __frame, function __$Node_prototype_path__14() { _this = __this; |
| 308 | + Node.prototype.path = function Node_prototype_path__14(to, type, direction, maxDepth, algorithm, _) { var data, end, length, nodes, pathURL, relationships, res, start, _this, __this = this; var __frame = { name: "Node_prototype_path__14", line: 308 }; return __func(_, this, arguments, Node_prototype_path__14, 5, __frame, function __$Node_prototype_path__14() { _this = __this; |
288 | 309 |
|
289 | 310 |
|
290 | 311 | if ((maxDepth == null)) { |
|
341 | 362 |
|
342 | 363 | return Node; |
343 | 364 |
|
344 | | - })(PropertyContainer); |
| 365 | + }).call(this, PropertyContainer); |
345 | 366 |
|
346 | 367 | }).call(this); |
0 commit comments