proto.io 0.0.195 → 0.0.196
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/index.js +2 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -669,12 +669,8 @@ const proxy = (x) => {
|
|
|
669
669
|
for (const name of _.uniq(_.flatMap(utilsJs.prototypes(proxy), x => Object.getOwnPropertyNames(x)))) {
|
|
670
670
|
if (name === 'constructor')
|
|
671
671
|
continue;
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
}
|
|
675
|
-
else {
|
|
676
|
-
Object.defineProperty(proxy, name, { get: () => self[name] });
|
|
677
|
-
}
|
|
672
|
+
const value = _.isFunction(self[name]) ? self[name].bind(self) : self[name];
|
|
673
|
+
Object.defineProperty(proxy, name, { get: () => value });
|
|
678
674
|
}
|
|
679
675
|
return proxy;
|
|
680
676
|
};
|
|
@@ -2054,18 +2050,6 @@ var classesRoute = (router, proto) => {
|
|
|
2054
2050
|
// THE SOFTWARE.
|
|
2055
2051
|
//
|
|
2056
2052
|
var functionRoute = (router, proto) => {
|
|
2057
|
-
router.get('/functions/:name', async (req, res) => {
|
|
2058
|
-
res.setHeader('Cache-Control', ['no-cache', 'no-store']);
|
|
2059
|
-
const { name } = req.params;
|
|
2060
|
-
if (_.isNil(proto[_private.PVK].functions[name]))
|
|
2061
|
-
return void res.sendStatus(404);
|
|
2062
|
-
await response(res, () => {
|
|
2063
|
-
const payload = proto.connect(req, x => ({
|
|
2064
|
-
params: null,
|
|
2065
|
-
}));
|
|
2066
|
-
return payload[_private.PVK].run(payload, name, payload, { master: payload.isMaster });
|
|
2067
|
-
});
|
|
2068
|
-
});
|
|
2069
2053
|
router.post('/functions/:name', serverJs.Server.text({ type: '*/*' }), async (req, res) => {
|
|
2070
2054
|
res.setHeader('Cache-Control', ['no-cache', 'no-store']);
|
|
2071
2055
|
const { name } = req.params;
|
|
@@ -2106,16 +2090,6 @@ var functionRoute = (router, proto) => {
|
|
|
2106
2090
|
// THE SOFTWARE.
|
|
2107
2091
|
//
|
|
2108
2092
|
var jobRoute = (router, proto) => {
|
|
2109
|
-
router.get('/jobs/:name', async (req, res) => {
|
|
2110
|
-
res.setHeader('Cache-Control', ['no-cache', 'no-store']);
|
|
2111
|
-
const { name } = req.params;
|
|
2112
|
-
if (_.isNil(proto[_private.PVK].jobs[name]))
|
|
2113
|
-
return void res.sendStatus(404);
|
|
2114
|
-
await response(res, () => {
|
|
2115
|
-
const payload = proto.connect(req);
|
|
2116
|
-
return payload[_private.PVK].scheduleJob(payload, name, null, { master: payload.isMaster });
|
|
2117
|
-
});
|
|
2118
|
-
});
|
|
2119
2093
|
router.post('/jobs/:name', serverJs.Server.text({ type: '*/*' }), async (req, res) => {
|
|
2120
2094
|
res.setHeader('Cache-Control', ['no-cache', 'no-store']);
|
|
2121
2095
|
const { name } = req.params;
|