seishiro 0.2.2-release → 0.2.3-release
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/cjs/action-tool/action-elysia.js +1 -1
- package/cjs/action-tool/action-express.js +1 -1
- package/cjs/action-tool/action-fastify.js +1 -1
- package/cjs/action-tool/action-hono.js +1 -1
- package/cjs/action-tool/action-next.js +1 -1
- package/esm/action-tool/action-elysia.js +1 -1
- package/esm/action-tool/action-express.js +1 -1
- package/esm/action-tool/action-fastify.js +1 -1
- package/esm/action-tool/action-hono.js +1 -1
- package/esm/action-tool/action-next.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=t,exports.ActionResponse=r;const e=require("../utils/system-helpers.js");async function t(t){const r=(0,e.mapHeaders)(t.request.headers),s={};t.cookie&&Object.entries(t.cookie).forEach(([e,t])=>s[e]=String(t.value).trim());const o=t.body||{};return{system:{headers:r,cookies:s,ip:(0,e.getIp)(r,t.request.headers.get("x-real-ip")),location:(0,e.getLocation)(r)},type:String(o?.type||""),data:o?.data||{}}}function r(e,t){if(!t
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=t,exports.ActionResponse=r;const e=require("../utils/system-helpers.js");async function t(t){const r=(0,e.mapHeaders)(t.request.headers),s={};t.cookie&&Object.entries(t.cookie).forEach(([e,t])=>s[e]=String(t.value).trim());const o=t.body||{};return{system:{headers:r,cookies:s,ip:(0,e.getIp)(r,t.request.headers.get("x-real-ip")),location:(0,e.getLocation)(r)},type:String(o?.type||""),data:o?.data||{}}}function r(e,t){if(!t?.redirect)return Array.isArray(t.header)&&t.header.forEach(t=>{t.key&&t.value&&(e.headers[t.key]=t.value)}),e.status=t.status||200,t.response||{};e.redirect=t.redirect}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=r,exports.ActionResponse=o;const e=require("../utils/system-helpers.js");function r(r){const o=(0,e.mapHeaders)(r.headers),t={};r.cookies&&Object.entries(r.cookies).forEach(([e,r])=>t[e]=String(r).trim());const s=r.body||{};return{system:{headers:o,cookies:t,ip:(0,e.getIp)(o,r.ip||r.connection?.remoteAddress),location:(0,e.getLocation)(o)},type:String(s?.type||""),data:s?.data||{}}}function o(e,r){return r
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=r,exports.ActionResponse=o;const e=require("../utils/system-helpers.js");function r(r){const o=(0,e.mapHeaders)(r.headers),t={};r.cookies&&Object.entries(r.cookies).forEach(([e,r])=>t[e]=String(r).trim());const s=r.body||{};return{system:{headers:o,cookies:t,ip:(0,e.getIp)(o,r.ip||r.connection?.remoteAddress),location:(0,e.getLocation)(o)},type:String(s?.type||""),data:s?.data||{}}}function o(e,r){return r?.redirect?e.redirect(r.redirect):(e.status(r.status||200),Array.isArray(r.header)&&r.header.forEach(r=>{r.key&&r.value&&e.set(r.key,r.value)}),Array.isArray(r.set_cookie)&&r.set_cookie.forEach(r=>{r.key&&r.value&&e.cookie(r.key,r.value,r.options||{})}),Array.isArray(r.rm_cookie)&&r.rm_cookie.forEach(r=>{const o="string"==typeof r?r:r?.key;o&&e.clearCookie(o)}),e.json(r.response||{}))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=o,exports.ActionResponse=r;const e=require("../utils/system-helpers.js");function o(o){const r=(0,e.mapHeaders)(o.headers),t={};o.cookies&&Object.entries(o.cookies).forEach(([e,o])=>t[e]=String(o).trim());const s=o.body||{};return{system:{headers:r,cookies:t,ip:(0,e.getIp)(r,o.ip),location:(0,e.getLocation)(r)},type:String(s?.type||""),data:s?.data||{}}}function r(e,o){return o
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=o,exports.ActionResponse=r;const e=require("../utils/system-helpers.js");function o(o){const r=(0,e.mapHeaders)(o.headers),t={};o.cookies&&Object.entries(o.cookies).forEach(([e,o])=>t[e]=String(o).trim());const s=o.body||{};return{system:{headers:r,cookies:t,ip:(0,e.getIp)(r,o.ip),location:(0,e.getLocation)(r)},type:String(s?.type||""),data:s?.data||{}}}function r(e,o){return o?.redirect?e.redirect(o.redirect):(Array.isArray(o.header)&&o.header.forEach(o=>{o.key&&o.value&&e.header(o.key,o.value)}),Array.isArray(o.set_cookie)&&o.set_cookie.forEach(o=>{o.key&&o.value&&"function"==typeof e.setCookie?e.setCookie(o.key,o.value,o.options||{}):o.key&&o.value&&e.header("Set-Cookie",`${o.key}=${o.value}`,{append:!0})}),Array.isArray(o.rm_cookie)&&o.rm_cookie.forEach(o=>{const r="string"==typeof o?o:o?.key;r&&"function"==typeof e.clearCookie&&e.clearCookie(r)}),e.code(o.status||200).send(o.response||{}))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=t,exports.ActionResponse=r;const e=require("../utils/system-helpers.js");async function t(t){const r=(0,e.mapHeaders)(t.req.header()),a={};(t.req.header("cookie")||"").split(";").forEach(e=>{const[t,r]=e.split("=").map(e=>e.trim());t&&r&&(a[t]=r)});let s={type:"",data:{}};try{s=(t.req.header("content-type")||"").includes("json")?await t.req.json():await t.req.parseBody()}catch(e){}return{system:{headers:r,cookies:a,ip:(0,e.getIp)(r),location:(0,e.getLocation)(r)},type:String(s?.type||""),data:s?.data||{}}}function r(e,t){return t
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=t,exports.ActionResponse=r;const e=require("../utils/system-helpers.js");async function t(t){const r=(0,e.mapHeaders)(t.req.header()),a={};(t.req.header("cookie")||"").split(";").forEach(e=>{const[t,r]=e.split("=").map(e=>e.trim());t&&r&&(a[t]=r)});let s={type:"",data:{}};try{s=(t.req.header("content-type")||"").includes("json")?await t.req.json():await t.req.parseBody()}catch(e){}return{system:{headers:r,cookies:a,ip:(0,e.getIp)(r),location:(0,e.getLocation)(r)},type:String(s?.type||""),data:s?.data||{}}}function r(e,t){return t?.redirect?e.redirect(t.redirect):(Array.isArray(t.header)&&t.header.forEach(t=>{t.key&&t.value&&e.header(t.key,t.value)}),Array.isArray(t.set_cookie)&&t.set_cookie.forEach(t=>{t.key&&t.value&&e.header("Set-Cookie",`${t.key}=${t.value}`,{append:!0})}),e.json(t.response||{},t.status||200))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(o){if(o&&o.__esModule)return o;var n={};if(null!=o)for(var i=r(o),s=0;s<i.length;s++)"default"!==i[s]&&e(n,o,i[s]);return t(n,o),n}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=n,exports.ActionResponse=i;const o=require("../utils/system-helpers.js");async function n(e){const{headers:t,cookies:n}=await Promise.resolve().then(()=>r(require("next/headers"))),{ipAddress:i}=await Promise.resolve().then(()=>r(require("@vercel/functions"))),s=await t(),a=await n(),c=(0,o.mapHeaders)(s),u=(0,o.getIp)(c,"function"==typeof i?i({headers:s}):void 0),l=(0,o.getLocation)(c),f=s.get("content-type")||"";let d={type:"",data:{}};try{if(f.includes("application/json"))d=await e.json();else if(f.includes("multipart/form-data")||f.includes("application/x-www-form-urlencoded")){const t=await e.formData(),r={};for(const[e,o]of t.entries()){const t=e.split(".");let n=r;for(let e=0;e<t.length;e++){const r=t[e];if(e===t.length-1)if(o instanceof Blob){const e=await o.arrayBuffer();n[r]=Buffer.from(e)}else n[r]=o;else n[r]=n[r]||{},n=n[r]}}d=r}}catch(e){console.error("[Seishiro ActionRequest]: Body parsing failed:",e.message)}const p={},y=a.getAll();if(Array.isArray(y))for(const e of y)p[e.name]=String(e.value).trim();return{system:{headers:c,cookies:p,ip:u,location:l},type:String(d?.type||""),data:d?.data||{}}}async function i(e,t){const{NextResponse:o}=await Promise.resolve().then(()=>r(require("next/server")));if(t
|
|
1
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},r(e)};return function(o){if(o&&o.__esModule)return o;var n={};if(null!=o)for(var i=r(o),s=0;s<i.length;s++)"default"!==i[s]&&e(n,o,i[s]);return t(n,o),n}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRequest=n,exports.ActionResponse=i;const o=require("../utils/system-helpers.js");async function n(e){const{headers:t,cookies:n}=await Promise.resolve().then(()=>r(require("next/headers"))),{ipAddress:i}=await Promise.resolve().then(()=>r(require("@vercel/functions"))),s=await t(),a=await n(),c=(0,o.mapHeaders)(s),u=(0,o.getIp)(c,"function"==typeof i?i({headers:s}):void 0),l=(0,o.getLocation)(c),f=s.get("content-type")||"";let d={type:"",data:{}};try{if(f.includes("application/json"))d=await e.json();else if(f.includes("multipart/form-data")||f.includes("application/x-www-form-urlencoded")){const t=await e.formData(),r={};for(const[e,o]of t.entries()){const t=e.split(".");let n=r;for(let e=0;e<t.length;e++){const r=t[e];if(e===t.length-1)if(o instanceof Blob){const e=await o.arrayBuffer();n[r]=Buffer.from(e)}else n[r]=o;else n[r]=n[r]||{},n=n[r]}}d=r}}catch(e){console.error("[Seishiro ActionRequest]: Body parsing failed:",e.message)}const p={},y=a.getAll();if(Array.isArray(y))for(const e of y)p[e.name]=String(e.value).trim();return{system:{headers:c,cookies:p,ip:u,location:l},type:String(d?.type||""),data:d?.data||{}}}async function i(e,t){const{NextResponse:o}=await Promise.resolve().then(()=>r(require("next/server")));if(t?.redirect)return o.redirect(new URL(t.redirect,e.url));const n=o.json(t.response||{},{status:t.status||200});return Array.isArray(t.header)&&t.header.forEach(e=>{e.key&&e.value&&n.headers.set(e.key,e.value)}),Array.isArray(t.set_cookie)&&t.set_cookie.forEach(e=>{e.key&&e.value&&n.cookies.set(e.key,e.value,e.options||{})}),Array.isArray(t.rm_cookie)&&t.rm_cookie.forEach(e=>{const t="string"==typeof e?e:e?.key;t&&n.cookies.delete(t)}),n}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mapHeaders as e,getIp as r,getLocation as t}from"../utils/system-helpers.js";export async function ActionRequest(s){const o=e(s.request.headers),a={};s.cookie&&Object.entries(s.cookie).forEach(([e,r])=>a[e]=String(r.value).trim());const i=s.body||{};return{system:{headers:o,cookies:a,ip:r(o,s.request.headers.get("x-real-ip")),location:t(o)},type:String(i?.type||""),data:i?.data||{}}}export function ActionResponse(e,r){if(!r
|
|
1
|
+
import{mapHeaders as e,getIp as r,getLocation as t}from"../utils/system-helpers.js";export async function ActionRequest(s){const o=e(s.request.headers),a={};s.cookie&&Object.entries(s.cookie).forEach(([e,r])=>a[e]=String(r.value).trim());const i=s.body||{};return{system:{headers:o,cookies:a,ip:r(o,s.request.headers.get("x-real-ip")),location:t(o)},type:String(i?.type||""),data:i?.data||{}}}export function ActionResponse(e,r){if(!r?.redirect)return Array.isArray(r.header)&&r.header.forEach(r=>{r.key&&r.value&&(e.headers[r.key]=r.value)}),e.status=r.status||200,r.response||{};e.redirect=r.redirect}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mapHeaders as e,getIp as r,getLocation as o}from"../utils/system-helpers.js";export function ActionRequest(t){const s=e(t.headers),i={};t.cookies&&Object.entries(t.cookies).forEach(([e,r])=>i[e]=String(r).trim());const c=t.body||{};return{system:{headers:s,cookies:i,ip:r(s,t.ip||t.connection?.remoteAddress),location:o(s)},type:String(c?.type||""),data:c?.data||{}}}export function ActionResponse(e,r){return r
|
|
1
|
+
import{mapHeaders as e,getIp as r,getLocation as o}from"../utils/system-helpers.js";export function ActionRequest(t){const s=e(t.headers),i={};t.cookies&&Object.entries(t.cookies).forEach(([e,r])=>i[e]=String(r).trim());const c=t.body||{};return{system:{headers:s,cookies:i,ip:r(s,t.ip||t.connection?.remoteAddress),location:o(s)},type:String(c?.type||""),data:c?.data||{}}}export function ActionResponse(e,r){return r?.redirect?e.redirect(r.redirect):(e.status(r.status||200),Array.isArray(r.header)&&r.header.forEach(r=>{r.key&&r.value&&e.set(r.key,r.value)}),Array.isArray(r.set_cookie)&&r.set_cookie.forEach(r=>{r.key&&r.value&&e.cookie(r.key,r.value,r.options||{})}),Array.isArray(r.rm_cookie)&&r.rm_cookie.forEach(r=>{const o="string"==typeof r?r:r?.key;o&&e.clearCookie(o)}),e.json(r.response||{}))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mapHeaders as e,getIp as o,getLocation as r}from"../utils/system-helpers.js";export function ActionRequest(t){const i=e(t.headers),s={};t.cookies&&Object.entries(t.cookies).forEach(([e,o])=>s[e]=String(o).trim());const a=t.body||{};return{system:{headers:i,cookies:s,ip:o(i,t.ip),location:r(i)},type:String(a?.type||""),data:a?.data||{}}}export function ActionResponse(e,o){return o
|
|
1
|
+
import{mapHeaders as e,getIp as o,getLocation as r}from"../utils/system-helpers.js";export function ActionRequest(t){const i=e(t.headers),s={};t.cookies&&Object.entries(t.cookies).forEach(([e,o])=>s[e]=String(o).trim());const a=t.body||{};return{system:{headers:i,cookies:s,ip:o(i,t.ip),location:r(i)},type:String(a?.type||""),data:a?.data||{}}}export function ActionResponse(e,o){return o?.redirect?e.redirect(o.redirect):(Array.isArray(o.header)&&o.header.forEach(o=>{o.key&&o.value&&e.header(o.key,o.value)}),Array.isArray(o.set_cookie)&&o.set_cookie.forEach(o=>{o.key&&o.value&&"function"==typeof e.setCookie?e.setCookie(o.key,o.value,o.options||{}):o.key&&o.value&&e.header("Set-Cookie",`${o.key}=${o.value}`,{append:!0})}),Array.isArray(o.rm_cookie)&&o.rm_cookie.forEach(o=>{const r="string"==typeof o?o:o?.key;r&&"function"==typeof e.clearCookie&&e.clearCookie(r)}),e.code(o.status||200).send(o.response||{}))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mapHeaders as e,getIp as r,getLocation as t}from"../utils/system-helpers.js";export async function ActionRequest(a){const o=e(a.req.header()),s={};(a.req.header("cookie")||"").split(";").forEach(e=>{const[r,t]=e.split("=").map(e=>e.trim());r&&t&&(s[r]=t)});let i={type:"",data:{}};try{i=(a.req.header("content-type")||"").includes("json")?await a.req.json():await a.req.parseBody()}catch(e){}return{system:{headers:o,cookies:s,ip:r(o),location:t(o)},type:String(i?.type||""),data:i?.data||{}}}export function ActionResponse(e,r){return r
|
|
1
|
+
import{mapHeaders as e,getIp as r,getLocation as t}from"../utils/system-helpers.js";export async function ActionRequest(a){const o=e(a.req.header()),s={};(a.req.header("cookie")||"").split(";").forEach(e=>{const[r,t]=e.split("=").map(e=>e.trim());r&&t&&(s[r]=t)});let i={type:"",data:{}};try{i=(a.req.header("content-type")||"").includes("json")?await a.req.json():await a.req.parseBody()}catch(e){}return{system:{headers:o,cookies:s,ip:r(o),location:t(o)},type:String(i?.type||""),data:i?.data||{}}}export function ActionResponse(e,r){return r?.redirect?e.redirect(r.redirect):(Array.isArray(r.header)&&r.header.forEach(r=>{r.key&&r.value&&e.header(r.key,r.value)}),Array.isArray(r.set_cookie)&&r.set_cookie.forEach(r=>{r.key&&r.value&&e.header("Set-Cookie",`${r.key}=${r.value}`,{append:!0})}),e.json(r.response||{},r.status||200))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mapHeaders as e,getIp as t,getLocation as r}from"../utils/system-helpers.js";export async function ActionRequest(o){const{headers:s,cookies:a}=await import("next/headers"),{ipAddress:i}=await import("@vercel/functions"),n=await s(),c=await a(),l=e(n),f=t(l,"function"==typeof i?i({headers:n}):void 0),p=r(l),y=n.get("content-type")||"";let d={type:"",data:{}};try{if(y.includes("application/json"))d=await o.json();else if(y.includes("multipart/form-data")||y.includes("application/x-www-form-urlencoded")){const e=await o.formData(),t={};for(const[r,o]of e.entries()){const e=r.split(".");let s=t;for(let t=0;t<e.length;t++){const r=e[t];if(t===e.length-1)if(o instanceof Blob){const e=await o.arrayBuffer();s[r]=Buffer.from(e)}else s[r]=o;else s[r]=s[r]||{},s=s[r]}}d=t}}catch(e){console.error("[Seishiro ActionRequest]: Body parsing failed:",e.message)}const u={},m=c.getAll();if(Array.isArray(m))for(const e of m)u[e.name]=String(e.value).trim();return{system:{headers:l,cookies:u,ip:f,location:p},type:String(d?.type||""),data:d?.data||{}}}export async function ActionResponse(e,t){const{NextResponse:r}=await import("next/server");if(t
|
|
1
|
+
import{mapHeaders as e,getIp as t,getLocation as r}from"../utils/system-helpers.js";export async function ActionRequest(o){const{headers:s,cookies:a}=await import("next/headers"),{ipAddress:i}=await import("@vercel/functions"),n=await s(),c=await a(),l=e(n),f=t(l,"function"==typeof i?i({headers:n}):void 0),p=r(l),y=n.get("content-type")||"";let d={type:"",data:{}};try{if(y.includes("application/json"))d=await o.json();else if(y.includes("multipart/form-data")||y.includes("application/x-www-form-urlencoded")){const e=await o.formData(),t={};for(const[r,o]of e.entries()){const e=r.split(".");let s=t;for(let t=0;t<e.length;t++){const r=e[t];if(t===e.length-1)if(o instanceof Blob){const e=await o.arrayBuffer();s[r]=Buffer.from(e)}else s[r]=o;else s[r]=s[r]||{},s=s[r]}}d=t}}catch(e){console.error("[Seishiro ActionRequest]: Body parsing failed:",e.message)}const u={},m=c.getAll();if(Array.isArray(m))for(const e of m)u[e.name]=String(e.value).trim();return{system:{headers:l,cookies:u,ip:f,location:p},type:String(d?.type||""),data:d?.data||{}}}export async function ActionResponse(e,t){const{NextResponse:r}=await import("next/server");if(t?.redirect)return r.redirect(new URL(t.redirect,e.url));const o=r.json(t.response||{},{status:t.status||200});return Array.isArray(t.header)&&t.header.forEach(e=>{e.key&&e.value&&o.headers.set(e.key,e.value)}),Array.isArray(t.set_cookie)&&t.set_cookie.forEach(e=>{e.key&&e.value&&o.cookies.set(e.key,e.value,e.options||{})}),Array.isArray(t.rm_cookie)&&t.rm_cookie.forEach(e=>{const t="string"==typeof e?e:e?.key;t&&o.cookies.delete(t)}),o}
|