@shellicar/svelte-adapter-azure-functions 0.2.2 → 0.4.0

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/types.js CHANGED
@@ -1 +1 @@
1
- import{init_cjs_shim as m}from"./chunk-AW5NC2LL.js";m();//# sourceMappingURL=types.js.map
1
+ import{init_cjs_shim as m}from"./chunk-2D6XOMK3.js";m();//# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shellicar/svelte-adapter-azure-functions",
3
3
  "private": false,
4
- "version": "0.2.2",
4
+ "version": "0.4.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Stephen Hellicar",
@@ -35,19 +35,19 @@
35
35
  }
36
36
  },
37
37
  "devDependencies": {
38
- "@azure/functions": "^4.6.0",
39
- "@sveltejs/kit": "^2.15.2",
40
- "@types/node": "^22.10.5",
38
+ "@azure/functions": "^4.7.3",
39
+ "@sveltejs/kit": "^2.27.0",
40
+ "@types/node": "^24.1.0",
41
41
  "@types/set-cookie-parser": "^2.4.10",
42
42
  "set-cookie-parser": "^2.7.1",
43
- "terser": "^5.37.0",
44
- "tsup": "^8.3.5",
45
- "tsx": "^4.19.2",
46
- "typescript": "^5.7.3",
47
- "vitest": "^2.1.8"
43
+ "terser": "^5.43.1",
44
+ "tsup": "^8.5.0",
45
+ "tsx": "^4.20.3",
46
+ "typescript": "^5.9.2",
47
+ "vitest": "^3.2.4"
48
48
  },
49
49
  "dependencies": {
50
- "esbuild": "^0.24.2"
50
+ "esbuild": "^0.25.8"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "tsup",
@@ -1 +0,0 @@
1
- import{defaults as r}from"./chunk-6TUT2TP2.js";import{__name as e,init_cjs_shim as t}from"./chunk-AW5NC2LL.js";t();import{writeFileSync as i}from"node:fs";import{join as o,posix as n}from"node:path";import{fileURLToPath as s}from"node:url";import{build as a}from"esbuild";var m=e(((e={})=>({name:"adapter-azure-functions",async adapt(t){const{esbuildOptions:m={}}=e,p="build",l=t.getBuildDirectory("adapter-azure-functions"),c=o(p,"server"),d=o(p,"static");t.log.minor(`Publishing to "${p}"`),t.rimraf(p),t.rimraf(l),t.log.minor("Copying assets..."),t.writeClient(d),t.writePrerendered(d);const f=s(new URL("../dist",import.meta.url)),u=n.relative(l,o(t.getServerDirectory()));t.log.minor("Generating serverless function..."),t.copy(f,l,{replace:{MANIFEST:"./manifest.js",SERVER:`${u}/index.js`,SHIMS:"./shims.js"}}),i(`${l}/manifest.js`,`export const manifest = ${t.generateManifest({relativePath:u})};\n`),await a({entryPoints:[`${l}/trigger.js`],outdir:o(c,"dist"),...r,...m});const g=s(new URL("../files",import.meta.url));t.log.minor("Copying files to server directory"),t.copy(g,c)}})),"createAdapter");export{m as createAdapter};//# sourceMappingURL=chunk-42KILSBR.js.map
@@ -1 +0,0 @@
1
- var e=Object.create,r=Object.defineProperty,t=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,u=(e,t)=>r(e,"name",{value:t,configurable:!0}),f=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,r)=>("undefined"!=typeof require?require:e)[r]}):e)((function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')})),p=(e,r)=>function(){return r||(0,e[o(e)[0]])((r={exports:{}}).exports,r),r.exports},a=(u,f,p)=>(p=null!=u?e(n(u)):{},((e,n,u,f)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let p of o(n))i.call(e,p)||p===u||r(e,p,{get:()=>n[p],enumerable:!(f=t(n,p))||f.enumerable});return e})(!f&&u&&u.__esModule?p:r(p,"default",{value:u,enumerable:!0}),u));import{createRequire as l}from"node:module";import m from"node:path";import d from"node:url";var c,s,y=(c={"cjs-shim.mts"(){globalThis.require=l(import.meta.url),globalThis.__filename=d.fileURLToPath(import.meta.url),globalThis.__dirname=m.dirname(__filename)}},function(){return c&&(s=(0,c[o(c)[0]])(c=0)),s});export{u as __name,f as __require,p as __commonJS,a as __toESM,y as init_cjs_shim};//# sourceMappingURL=chunk-AW5NC2LL.js.map
@@ -1 +0,0 @@
1
- import{__name as r,init_cjs_shim as t}from"./chunk-AW5NC2LL.js";t();import"SHIMS";import{manifest as e}from"MANIFEST";import{Server as i}from"SERVER";var o=r((async()=>{const r=new i(e);return await r.init({env:process.env}),r}),"getInitializedServer")();export{o as serverPromise};//# sourceMappingURL=chunk-GKOGVGYC.js.map
@@ -1 +0,0 @@
1
- import{__commonJS as e,__name as r,__toESM as t,init_cjs_shim as o}from"./chunk-AW5NC2LL.js";var s=e({"../../node_modules/.pnpm/set-cookie-parser@2.7.1/node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){o();var s={decodeValues:!0,map:!1,silent:!1};function n(e){return"string"==typeof e&&!!e.trim()}function i(e,r){var t=e.split(";").filter(n),o=a(t.shift()),i=o.name,c=o.value;r=r?Object.assign({},s,r):s;try{c=r.decodeValues?decodeURIComponent(c):c}catch(e){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+c+"'. Set options.decodeValues to false to disable this feature.",e)}var p={name:i,value:c};return t.forEach((function(e){var r=e.split("="),t=r.shift().trimLeft().toLowerCase(),o=r.join("=");"expires"===t?p.expires=new Date(o):"max-age"===t?p.maxAge=parseInt(o,10):"secure"===t?p.secure=!0:"httponly"===t?p.httpOnly=!0:"samesite"===t?p.sameSite=o:"partitioned"===t?p.partitioned=!0:p[t]=o})),p}function a(e){var r="",t="",o=e.split("=");return o.length>1?(r=o.shift(),t=o.join("=")):t=e,{name:r,value:t}}function c(e,r){if(r=r?Object.assign({},s,r):s,!e)return r.map?{}:[];if(e.headers)if("function"==typeof e.headers.getSetCookie)e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var t=e.headers[Object.keys(e.headers).find((function(e){return"set-cookie"===e.toLowerCase()}))];t||!e.headers.cookie||r.silent||console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=t}if(Array.isArray(e)||(e=[e]),r.map){return e.filter(n).reduce((function(e,t){var o=i(t,r);return e[o.name]=o,e}),{})}return e.filter(n).map((function(e){return i(e,r)}))}function p(e){if(Array.isArray(e))return e;if("string"!=typeof e)return[];var t,o,s,n,i,a=[],c=0;function p(){for(;c<e.length&&/\s/.test(e.charAt(c));)c+=1;return c<e.length}function l(){return"="!==(o=e.charAt(c))&&";"!==o&&","!==o}for(r(p,"skipWhitespace"),r(l,"notSpecialChar");c<e.length;){for(t=c,i=!1;p();)if(","===(o=e.charAt(c))){for(s=c,c+=1,p(),n=c;c<e.length&&l();)c+=1;c<e.length&&"="===e.charAt(c)?(i=!0,c=n,a.push(e.substring(t,s)),t=c):c=s+1}else c+=1;(!i||c>=e.length)&&a.push(e.substring(t,e.length))}return a}r(n,"isNonEmptyString"),r(i,"parseString"),r(a,"parseNameValuePair"),r(c,"parse"),r(p,"splitCookiesString"),t.exports=c,t.exports.parse=c,t.exports.parseString=i,t.exports.splitCookiesString=p}});o();var n=t(s(),1),i=r((e=>{const r={},t=[];return e.forEach(((e,o)=>{if("set-cookie"===o){const r=(0,n.splitCookiesString)(e);t.push(...(0,n.parse)(r))}else r[o]=e})),{headers:r,cookies:t}}),"splitCookiesFromHeaders"),a=r((e=>{const r=e.get("x-forwarded-for")??"127.0.0.1",[t]=r.split(", "),[o]=t.split(":");return o}),"getClientIPFromHeaders");function c(e){const r=e.get("x-ms-client-principal");if(r)try{const e=Buffer.from(r,"base64").toString("utf-8");return JSON.parse(e)}catch(e){return void console.log("Unable to parse client principal:",e)}}r(c,"getClientPrincipalFromHeaders");export{i as splitCookiesFromHeaders,a as getClientIPFromHeaders,c as getClientPrincipalFromHeaders};//# sourceMappingURL=chunk-JITMWCAX.js.map
@@ -1 +0,0 @@
1
- import{getClientIPFromHeaders as e,getClientPrincipalFromHeaders as r,splitCookiesFromHeaders as t}from"./chunk-JITMWCAX.js";import{serverPromise as s}from"./chunk-GKOGVGYC.js";import{__name as a,init_cjs_shim as o}from"./chunk-AW5NC2LL.js";o();var n=a((async e=>{const{method:r,headers:t,url:s}=e,a={method:r,headers:Object.fromEntries(t)};return"GET"!==r&&"HEAD"!==r&&(a.body=await e.arrayBuffer()),new Request(s,a)}),"toRequest"),d=a((async(a,o)=>{const d=await n(a),i=await s,c=e(d.headers),h=r(d.headers),u=await i.respond(d,{getClientAddress:()=>c,platform:{clientPrincipal:h,context:o}}),{headers:m,cookies:f}=t(u.headers);return{status:u.status,body:u.body,headers:m,cookies:f}}),"handler");export{d as handler};//# sourceMappingURL=chunk-UZCYXPAL.js.map