@joystick.js/node-canary 0.0.0-canary.469 → 0.0.0-canary.470

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.
@@ -1 +1 @@
1
- import c from"./format_api_error.js";import d from"./get_api_context.js";import f from"./get_api_url_component.js";import g from"./handle_api_error.js";import y from"./set.js";import h from"../../lib/types.js";import w from"./validate_session.js";const x=(_={},n=[],m={},u={})=>{for(let e=0;e<n?.length;e+=1){const[r,i]=n[e];_.post(`/api/_setters/${f(r)}`,...h.is_array(i?.middleware)?i?.middleware:[],async(o={},t={})=>{if(process.databases?._sessions&&!await w(o,t))return t.status(403).send(JSON.stringify({errors:[c(new Error("Unauthorized request."))]}));const l=await d(o,t,m),a=o?.body?.input||null,p=o?.body?.output||null;console.log({input:a,output:p}),y({set_name:r,set_options:{input:a,output:p},setter_definition:i,request_context:l,api_schema_options:u}).then(s=>t.status(200).send(JSON.stringify(s))).catch(s=>{g(`api.setters.${r}`,s,t)})})}};var z=x;export{z as default};
1
+ import c from"./format_api_error.js";import f from"./get_api_context.js";import l from"./get_api_url_component.js";import y from"./handle_api_error.js";import g from"./set.js";import h from"../../lib/types.js";import w from"./validate_session.js";const x=(a={},n=[],p={},_={})=>{for(let o=0;o<n?.length;o+=1){const[r,i]=n[o];a.post(`/api/_setters/${l(r)}`,...h.is_array(i?.middleware)?i?.middleware:[],async(s={},t={})=>{if(process.databases?._sessions&&!await w(s,t))return t.status(403).send(JSON.stringify({errors:[c(new Error("Unauthorized request."))]}));const m=await f(s,t,p),u=s?.body?.input||null,d=s?.body?.output||null;g({set_name:r,set_options:{input:u,output:d},setter_definition:i,request_context:m,api_schema_options:_}).then(e=>t.status(200).send(JSON.stringify(e))).catch(e=>{y(`api.setters.${r}`,e,t)})})}};var z=x;export{z as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joystick.js/node-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.469",
4
+ "version": "0.0.0-canary.470",
5
5
  "description": "The Node.js framework for Joystick.",
6
6
  "main": "./dist/index.js",
7
7
  "scripts": {
@@ -32,11 +32,6 @@ const register_setters = (express_app = {}, setter_definitions = [], api_context
32
32
  const input = req?.body?.input || null;
33
33
  const output = req?.body?.output || null;
34
34
 
35
- console.log({
36
- input,
37
- output,
38
- });
39
-
40
35
  set({
41
36
  set_name: setter_name,
42
37
  set_options: {