@uniformdev/canvas-next
Advanced tools
Comparing version 17.5.1-alpha.105 to 17.5.1-alpha.130
@@ -1,5 +0,21 @@ | ||
export { U as UniformCompositionNextPage, b as UniformGetServerSideProps, a as UniformGetStaticProps } from './models-de4a94fb.js'; | ||
export { U as UniformCompositionNextPage, b as UniformGetServerSideProps, a as UniformGetStaticProps } from './models-85d88e63.js'; | ||
import { NextApiHandler } from 'next'; | ||
import { RootComponentInstance } from '@uniformdev/canvas'; | ||
import '@uniformdev/canvas-react'; | ||
import '@uniformdev/canvas'; | ||
import 'next'; | ||
import 'querystring'; | ||
declare type CreatePreviewHandlerGet = (options?: { | ||
secret?: () => string; | ||
}) => NextApiHandler; | ||
declare const createPreviewHandlerGet: CreatePreviewHandlerGet; | ||
declare type CreatePreviewHandlerPost = (options?: { | ||
secret?: () => string; | ||
enhance?: (composition: RootComponentInstance) => Promise<void>; | ||
}) => NextApiHandler; | ||
declare const createPreviewHandlerPost: CreatePreviewHandlerPost; | ||
declare type CreatePreviewHandler = CreatePreviewHandlerPost; | ||
declare const createPreviewHandler: CreatePreviewHandler; | ||
export { CreatePreviewHandler, CreatePreviewHandlerGet, CreatePreviewHandlerPost, createPreviewHandler, createPreviewHandlerGet, createPreviewHandlerPost }; |
@@ -1,1 +0,1 @@ | ||
"use strict";var m=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var b=(r,o,p,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of x(o))!a.call(r,e)&&e!==p&&m(r,e,{get:()=>o[e],enumerable:!(f=t(o,e))||f.enumerable});return r};var c=r=>b(m({},"__esModule",{value:!0}),r);var d={};module.exports=c(d); | ||
"use strict";var l=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},H=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!w.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(n=g(e,o))||n.enumerable});return t};var h=t=>H(l({},"__esModule",{value:!0}),t);var x={};y(x,{createPreviewHandler:()=>C,createPreviewHandlerGet:()=>c,createPreviewHandlerPost:()=>d});module.exports=h(x);var P=require("@uniformdev/canvas"),c=({secret:t}={})=>async(e,r)=>{let n=[P.IN_CONTEXT_EDITOR_QUERY_STRING_PARAM];if(!e.query.slug)return r.status(400).json({message:"Missing slug"});let o=Array.isArray(e.query.slug)?e.query.slug[0]:e.query.slug;if(e.query.disable){r.clearPreviewData(),r.redirect(o);return}let a=typeof t=="function"?t==null?void 0:t():t;if(Boolean(a)&&e.query.secret!==a)return r.status(401).json({message:"Invalid token"});r.setPreviewData({});let s=new URLSearchParams;n.forEach(p=>{let m=e.query[p];typeof m=="string"&&s.append(p,m)});let i=s.toString()?`${o}?${s.toString()}`:o;r.redirect(i)};var f=require("@uniformdev/canvas"),d=({secret:t,enhance:e}={})=>async(r,n)=>{let{composition:o,hash:a}=r.body;if(!o)return n.status(422).json({message:'Missing "composition" parameter'});let u=typeof t=="function"?t==null?void 0:t():t,s=Boolean(a),i=Boolean(u);if(s&&i){if((0,f.generateHash)({composition:o,secret:u})!==a)return n.status(401).json({message:"Not authorized"})}else if(i)return n.status(401).json({message:"Not authorized"});return await(e==null?void 0:e(o)),n.status(200).json({composition:o})};var C=({secret:t,enhance:e}={})=>async(r,n)=>{var a;let o=(a=r.method)==null?void 0:a.toLocaleLowerCase();return o==="get"?c({secret:t})(r,n):o==="post"?d({secret:t,enhance:e})(r,n):n.status(501).json({message:`Method "${o}" not implemented`})};0&&(module.exports={createPreviewHandler,createPreviewHandlerGet,createPreviewHandlerPost}); |
@@ -6,3 +6,3 @@ import * as next from 'next'; | ||
import { CanvasClient } from '@uniformdev/canvas'; | ||
import { b as UniformGetServerSideProps, a as UniformGetStaticProps } from '../models-de4a94fb.js'; | ||
import { b as UniformGetServerSideProps, a as UniformGetStaticProps } from '../models-85d88e63.js'; | ||
import '@uniformdev/canvas-react'; | ||
@@ -9,0 +9,0 @@ |
{ | ||
"name": "@uniformdev/canvas-next", | ||
"version": "17.5.1-alpha.105+9b3f152e7", | ||
"version": "17.5.1-alpha.130+3fac779b1", | ||
"description": "Next.js SDK for Uniform Canvas", | ||
@@ -45,4 +45,4 @@ "license": "SEE LICENSE IN LICENSE.txt", | ||
"dependencies": { | ||
"@uniformdev/canvas": "^17.5.1-alpha.105+9b3f152e7", | ||
"@uniformdev/canvas-react": "^17.5.1-alpha.105+9b3f152e7" | ||
"@uniformdev/canvas": "^17.5.1-alpha.130+3fac779b1", | ||
"@uniformdev/canvas-react": "^17.5.1-alpha.130+3fac779b1" | ||
}, | ||
@@ -56,3 +56,3 @@ "peerDependencies": { | ||
"@types/react": "18.0.25", | ||
"next": "12.3.3", | ||
"next": "12.3.4", | ||
"react": "18.2.0", | ||
@@ -67,3 +67,3 @@ "react-dom": "18.2.0" | ||
}, | ||
"gitHead": "9b3f152e7455f37fd8609004bab4ded4a9a88bc7" | ||
"gitHead": "3fac779b1b42a1afeb05156cb51768a98573438f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
16369
117
4