@graffico/legal 0.3.1 → 0.3.2
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/next.cjs +1 -1
- package/dist/next.js +1 -1
- package/package.json +1 -1
package/dist/next.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var r in t)m(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of f(t))!d.call(e,s)&&s!==r&&m(e,s,{get:()=>t[s],enumerable:!(o=u(t,s))||o.enumerable});return e};var w=e=>C(m({},"__esModule",{value:!0}),e);var R={};y(R,{buildCspFromConfig:()=>p,buildLegalHeaders:()=>a,emitNetlifyHeaders:()=>h,mergeCsp:()=>i,serializeCsp:()=>n,withLegal:()=>g});module.exports=w(R);var k={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","blob:","https:"],"font-src":["'self'","data:"],"connect-src":["'self'"],"frame-src":["'self'"],"frame-ancestors":["'self'"],"base-uri":["'self'"],"form-action":["'self'"],"object-src":["'none'"],"upgrade-insecure-requests":[]},v={"google-analytics":{"script-src":["https://www.googletagmanager.com"],"connect-src":["https://www.google-analytics.com","https://analytics.google.com","https://region1.google-analytics.com","https://stats.g.doubleclick.net"],"img-src":["https://www.google-analytics.com"]},"google-ads":{"script-src":["https://www.googletagmanager.com"],"connect-src":["https://www.google.com","https://googleads.g.doubleclick.net"],"img-src":["https://www.google.com","https://googleads.g.doubleclick.net"],"frame-src":["https://td.doubleclick.net"]},"google-tag-manager":{"script-src":["https://www.googletagmanager.com"],"connect-src":["https://www.googletagmanager.com"]},"facebook-pixel":{"script-src":["https://connect.facebook.net"],"connect-src":["https://*.facebook.com","https://*.facebook.net"],"img-src":["https://www.facebook.com"]},"google-fonts":{"style-src":["https://fonts.googleapis.com"],"font-src":["https://fonts.gstatic.com"]},"contact-form":{"connect-src":["https://api.emailjs.com"]},youtube:{"frame-src":["https://www.youtube.com","https://www.youtube-nocookie.com"],"img-src":["https://i.ytimg.com"]},"google-maps":{"script-src":["https://maps.googleapis.com"],"frame-src":["https://www.google.com"],"img-src":["https://maps.googleapis.com","https://maps.gstatic.com"]},hotjar:{"script-src":["https://static.hotjar.com","https://script.hotjar.com"],"connect-src":["https://*.hotjar.com","https://*.hotjar.io","wss://*.hotjar.com"],"img-src":["https://static.hotjar.com"],"font-src":["https://script.hotjar.com"],"frame-src":["https://vars.hotjar.com"]},"microsoft-clarity":{"script-src":["https://www.clarity.ms"],"connect-src":["https://*.clarity.ms"]},"tiktok-pixel":{"script-src":["https://analytics.tiktok.com","https://*.tiktok.com"],"connect-src":["https://analytics.tiktok.com","https://*.tiktok.com"],"img-src":["https://analytics.tiktok.com"]},"linkedin-insight":{"script-src":["https://snap.licdn.com"],"connect-src":["https://px.ads.linkedin.com","https://snap.licdn.com"],"img-src":["https://px.ads.linkedin.com","https://*.linkedin.com"]},mailchimp:{"script-src":["https://chimpstatic.com","https://*.list-manage.com"],"connect-src":["https://*.list-manage.com"],"img-src":["https://*.list-manage.com"],"form-action":["https://*.list-manage.com"]},stripe:{"script-src":["https://js.stripe.com"],"frame-src":["https://js.stripe.com","https://hooks.stripe.com"],"connect-src":["https://api.stripe.com"]}};function b(e){let t=e.name.toLowerCase();return t.includes("contentful")?{"connect-src":["https://graphql.contentful.com","https://cdn.contentful.com","https://preview.contentful.com"],"img-src":["https://images.ctfassets.net"]}:t.includes("netlify")?{"img-src":["https://*.netlifyusercontent.com"]}:t.includes("vercel")?{"img-src":["https://*.vercel-storage.com"]}:t.includes("stripe")?{"script-src":["https://js.stripe.com"],"frame-src":["https://js.stripe.com","https://hooks.stripe.com"],"connect-src":["https://api.stripe.com"]}:{}}function i(...e){let t={};for(let r of e)if(r)for(let[o,s]of Object.entries(r)){if(!s)continue;let c=new Set([...t[o]??[],...s]);t[o]=Array.from(c)}return t}function x(e){return/[;,\r\n]/.test(e)?null:e.trim()}function n(e){return Object.entries(e).filter(([,t])=>t!==void 0).map(([t,r])=>{if(!r||r.length===0)return`${t}`;let o=r.map(x).filter(s=>s!==null&&s.length>0);return o.length>0?`${t} ${o.join(" ")}`:`${t}`}).join("; ")}function p(e,t){let r=(e.services??[]).map(s=>typeof s=="string"?s:s.id).map(s=>v[s]).filter(Boolean),o=(e.processors??[]).map(b);return i(k,...r,...o,t)}var j={camera:[],microphone:[],geolocation:[],payment:[],"interest-cohort":[],"browsing-topics":[]};function D(e){return Object.entries(e).map(([t,r])=>r.length===0?`${t}=()`:`${t}=(${r.map(o=>`"${o}"`).join(" ")})`).join(", ")}function a(e,t={}){let r=p(e,t.extraCsp),o=t.cspReportOnly?{...r,"upgrade-insecure-requests":void 0}:r,s=t.cspReportUri?i(o,{"report-uri":[t.cspReportUri]}):o,c=[];return c.push({key:t.cspReportOnly?"Content-Security-Policy-Report-Only":"Content-Security-Policy",value:n(s)}),t.skipHsts||c.push({key:"Strict-Transport-Security",value:"max-age=63072000; includeSubDomains; preload"}),c.push({key:"X-Frame-Options",value:"SAMEORIGIN"}),c.push({key:"X-Content-Type-Options",value:"nosniff"}),c.push({key:"Referrer-Policy",value:"strict-origin-when-cross-origin"}),c.push({key:"Permissions-Policy",value:D({...j,...t.permissionsPolicy??{}})}),c.push({key:"Cross-Origin-Opener-Policy",value:"same-origin"}),c}function g(e,t,r={}){let o=r.source??"/:path*",s=a(t,r),c=e.headers;return{...e,async headers(){return[...c?await c():[],{source:o,headers:s}]}}}function h(e,t={}){let r=a(e,t),o=" ",s=[];s.push("[[headers]]"),s.push(`${o}for = "${t.source??"/*"}"`),s.push(`${o}[headers.values]`);for(let c of r){let l=c.value.replace(/"/g,'\\"');s.push(`${o}${o}${c.key} = "${l}"`)}return s.join(`
|
|
2
2
|
`)}0&&(module.exports={buildCspFromConfig,buildLegalHeaders,emitNetlifyHeaders,mergeCsp,serializeCsp,withLegal});
|
package/dist/next.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var l={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","blob:","https:"],"font-src":["'self'","data:"],"connect-src":["'self'"],"frame-src":["'self'"],"frame-ancestors":["'self'"],"base-uri":["'self'"],"form-action":["'self'"],"object-src":["'none'"],"upgrade-insecure-requests":[]},g={"google-analytics":{"script-src":["https://www.googletagmanager.com"],"connect-src":["https://www.google-analytics.com","https://analytics.google.com","https://region1.google-analytics.com","https://stats.g.doubleclick.net"],"img-src":["https://www.google-analytics.com"]},"google-ads":{"script-src":["https://www.googletagmanager.com"],"connect-src":["https://www.google.com","https://googleads.g.doubleclick.net"],"img-src":["https://www.google.com","https://googleads.g.doubleclick.net"],"frame-src":["https://td.doubleclick.net"]},"google-tag-manager":{"script-src":["https://www.googletagmanager.com"],"connect-src":["https://www.googletagmanager.com"]},"facebook-pixel":{"script-src":["https://connect.facebook.net"],"connect-src":["https://*.facebook.com","https://*.facebook.net"],"img-src":["https://www.facebook.com"]},"google-fonts":{"style-src":["https://fonts.googleapis.com"],"font-src":["https://fonts.gstatic.com"]},"contact-form":{"connect-src":["https://api.emailjs.com"]},youtube:{"frame-src":["https://www.youtube.com","https://www.youtube-nocookie.com"],"img-src":["https://i.ytimg.com"]},"google-maps":{"script-src":["https://maps.googleapis.com"],"frame-src":["https://www.google.com"],"img-src":["https://maps.googleapis.com","https://maps.gstatic.com"]},hotjar:{"script-src":["https://static.hotjar.com","https://script.hotjar.com"],"connect-src":["https://*.hotjar.com","https://*.hotjar.io","wss://*.hotjar.com"],"img-src":["https://static.hotjar.com"],"font-src":["https://script.hotjar.com"],"frame-src":["https://vars.hotjar.com"]},"microsoft-clarity":{"script-src":["https://www.clarity.ms"],"connect-src":["https://*.clarity.ms"]},"tiktok-pixel":{"script-src":["https://analytics.tiktok.com","https://*.tiktok.com"],"connect-src":["https://analytics.tiktok.com","https://*.tiktok.com"],"img-src":["https://analytics.tiktok.com"]},"linkedin-insight":{"script-src":["https://snap.licdn.com"],"connect-src":["https://px.ads.linkedin.com","https://snap.licdn.com"],"img-src":["https://px.ads.linkedin.com","https://*.linkedin.com"]},mailchimp:{"script-src":["https://chimpstatic.com","https://*.list-manage.com"],"connect-src":["https://*.list-manage.com"],"img-src":["https://*.list-manage.com"],"form-action":["https://*.list-manage.com"]},stripe:{"script-src":["https://js.stripe.com"],"frame-src":["https://js.stripe.com","https://hooks.stripe.com"],"connect-src":["https://api.stripe.com"]}};function h(s){let t=s.name.toLowerCase();return t.includes("contentful")?{"connect-src":["https://graphql.contentful.com","https://cdn.contentful.com","https://preview.contentful.com"],"img-src":["https://images.ctfassets.net"]}:t.includes("netlify")?{"img-src":["https://*.netlifyusercontent.com"]}:t.includes("vercel")?{"img-src":["https://*.vercel-storage.com"]}:t.includes("stripe")?{"script-src":["https://js.stripe.com"],"frame-src":["https://js.stripe.com","https://hooks.stripe.com"],"connect-src":["https://api.stripe.com"]}:{}}function i(...s){let t={};for(let r of s)if(r)for(let[o,e]of Object.entries(r)){if(!e)continue;let c=new Set([...t[o]??[],...e]);t[o]=Array.from(c)}return t}function
|
|
1
|
+
var l={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","blob:","https:"],"font-src":["'self'","data:"],"connect-src":["'self'"],"frame-src":["'self'"],"frame-ancestors":["'self'"],"base-uri":["'self'"],"form-action":["'self'"],"object-src":["'none'"],"upgrade-insecure-requests":[]},g={"google-analytics":{"script-src":["https://www.googletagmanager.com"],"connect-src":["https://www.google-analytics.com","https://analytics.google.com","https://region1.google-analytics.com","https://stats.g.doubleclick.net"],"img-src":["https://www.google-analytics.com"]},"google-ads":{"script-src":["https://www.googletagmanager.com"],"connect-src":["https://www.google.com","https://googleads.g.doubleclick.net"],"img-src":["https://www.google.com","https://googleads.g.doubleclick.net"],"frame-src":["https://td.doubleclick.net"]},"google-tag-manager":{"script-src":["https://www.googletagmanager.com"],"connect-src":["https://www.googletagmanager.com"]},"facebook-pixel":{"script-src":["https://connect.facebook.net"],"connect-src":["https://*.facebook.com","https://*.facebook.net"],"img-src":["https://www.facebook.com"]},"google-fonts":{"style-src":["https://fonts.googleapis.com"],"font-src":["https://fonts.gstatic.com"]},"contact-form":{"connect-src":["https://api.emailjs.com"]},youtube:{"frame-src":["https://www.youtube.com","https://www.youtube-nocookie.com"],"img-src":["https://i.ytimg.com"]},"google-maps":{"script-src":["https://maps.googleapis.com"],"frame-src":["https://www.google.com"],"img-src":["https://maps.googleapis.com","https://maps.gstatic.com"]},hotjar:{"script-src":["https://static.hotjar.com","https://script.hotjar.com"],"connect-src":["https://*.hotjar.com","https://*.hotjar.io","wss://*.hotjar.com"],"img-src":["https://static.hotjar.com"],"font-src":["https://script.hotjar.com"],"frame-src":["https://vars.hotjar.com"]},"microsoft-clarity":{"script-src":["https://www.clarity.ms"],"connect-src":["https://*.clarity.ms"]},"tiktok-pixel":{"script-src":["https://analytics.tiktok.com","https://*.tiktok.com"],"connect-src":["https://analytics.tiktok.com","https://*.tiktok.com"],"img-src":["https://analytics.tiktok.com"]},"linkedin-insight":{"script-src":["https://snap.licdn.com"],"connect-src":["https://px.ads.linkedin.com","https://snap.licdn.com"],"img-src":["https://px.ads.linkedin.com","https://*.linkedin.com"]},mailchimp:{"script-src":["https://chimpstatic.com","https://*.list-manage.com"],"connect-src":["https://*.list-manage.com"],"img-src":["https://*.list-manage.com"],"form-action":["https://*.list-manage.com"]},stripe:{"script-src":["https://js.stripe.com"],"frame-src":["https://js.stripe.com","https://hooks.stripe.com"],"connect-src":["https://api.stripe.com"]}};function h(s){let t=s.name.toLowerCase();return t.includes("contentful")?{"connect-src":["https://graphql.contentful.com","https://cdn.contentful.com","https://preview.contentful.com"],"img-src":["https://images.ctfassets.net"]}:t.includes("netlify")?{"img-src":["https://*.netlifyusercontent.com"]}:t.includes("vercel")?{"img-src":["https://*.vercel-storage.com"]}:t.includes("stripe")?{"script-src":["https://js.stripe.com"],"frame-src":["https://js.stripe.com","https://hooks.stripe.com"],"connect-src":["https://api.stripe.com"]}:{}}function i(...s){let t={};for(let r of s)if(r)for(let[o,e]of Object.entries(r)){if(!e)continue;let c=new Set([...t[o]??[],...e]);t[o]=Array.from(c)}return t}function u(s){return/[;,\r\n]/.test(s)?null:s.trim()}function n(s){return Object.entries(s).filter(([,t])=>t!==void 0).map(([t,r])=>{if(!r||r.length===0)return`${t}`;let o=r.map(u).filter(e=>e!==null&&e.length>0);return o.length>0?`${t} ${o.join(" ")}`:`${t}`}).join("; ")}function p(s,t){let r=(s.services??[]).map(e=>typeof e=="string"?e:e.id).map(e=>g[e]).filter(Boolean),o=(s.processors??[]).map(h);return i(l,...r,...o,t)}var f={camera:[],microphone:[],geolocation:[],payment:[],"interest-cohort":[],"browsing-topics":[]};function d(s){return Object.entries(s).map(([t,r])=>r.length===0?`${t}=()`:`${t}=(${r.map(o=>`"${o}"`).join(" ")})`).join(", ")}function a(s,t={}){let r=p(s,t.extraCsp),o=t.cspReportOnly?{...r,"upgrade-insecure-requests":void 0}:r,e=t.cspReportUri?i(o,{"report-uri":[t.cspReportUri]}):o,c=[];return c.push({key:t.cspReportOnly?"Content-Security-Policy-Report-Only":"Content-Security-Policy",value:n(e)}),t.skipHsts||c.push({key:"Strict-Transport-Security",value:"max-age=63072000; includeSubDomains; preload"}),c.push({key:"X-Frame-Options",value:"SAMEORIGIN"}),c.push({key:"X-Content-Type-Options",value:"nosniff"}),c.push({key:"Referrer-Policy",value:"strict-origin-when-cross-origin"}),c.push({key:"Permissions-Policy",value:d({...f,...t.permissionsPolicy??{}})}),c.push({key:"Cross-Origin-Opener-Policy",value:"same-origin"}),c}function y(s,t,r={}){let o=r.source??"/:path*",e=a(t,r),c=s.headers;return{...s,async headers(){return[...c?await c():[],{source:o,headers:e}]}}}function C(s,t={}){let r=a(s,t),o=" ",e=[];e.push("[[headers]]"),e.push(`${o}for = "${t.source??"/*"}"`),e.push(`${o}[headers.values]`);for(let c of r){let m=c.value.replace(/"/g,'\\"');e.push(`${o}${o}${c.key} = "${m}"`)}return e.join(`
|
|
2
2
|
`)}export{p as buildCspFromConfig,a as buildLegalHeaders,C as emitNetlifyHeaders,i as mergeCsp,n as serializeCsp,y as withLegal};
|