@joystick.js/node-canary 0.0.0-canary.467 → 0.0.0-canary.469
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
|
|
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};
|
package/dist/app/ssr/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import u from"fs";import{parseHTML as p}from"linkedom";import y from"os";import
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
window.__joystick_platform__ = '${y.platform()}';
|
|
12
|
-
window.__joystick_data__ = '${Buffer.from(JSON.stringify(e?.data)).toString("base64")}';
|
|
12
|
+
window.__joystick_data__ = '${Buffer.from(JSON.stringify(e?.data),"utf8").toString("base64")}';
|
|
13
13
|
window.__joystick_i18n__ = ${JSON.stringify(e?.translations)};
|
|
14
14
|
${s?`window.__joystick_hmr_port__ = ${parseInt(process.env.PORT,10)+1}`:""}
|
|
15
15
|
window.__joystick_layout_url__ = ${e?.render_layout_path?`"/_joystick/${e?.render_layout_path}"`:null};
|
package/package.json
CHANGED
|
@@ -32,6 +32,11 @@ 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
|
+
|
|
35
40
|
set({
|
|
36
41
|
set_name: setter_name,
|
|
37
42
|
set_options: {
|
package/src/app/ssr/index.js
CHANGED
|
@@ -31,7 +31,7 @@ const build_html_response_for_browser = (options = {}) => {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
window.__joystick_platform__ = '${os.platform()}';
|
|
34
|
-
window.__joystick_data__ = '${Buffer.from(JSON.stringify(options?.data)).toString('base64')}';
|
|
34
|
+
window.__joystick_data__ = '${Buffer.from(JSON.stringify(options?.data), 'utf8').toString('base64')}';
|
|
35
35
|
window.__joystick_i18n__ = ${JSON.stringify(options?.translations)};
|
|
36
36
|
${is_development ? `window.__joystick_hmr_port__ = ${parseInt(process.env.PORT, 10) + 1}` : ''}
|
|
37
37
|
window.__joystick_layout_url__ = ${options?.render_layout_path ? `"/_joystick/${options?.render_layout_path}"` : null};
|