@metricinsights/pp-dev 1.5.0-beta.16 → 1.5.0-beta.18
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/README.md +2 -2
- package/dist/README.md +2 -2
- package/dist/cjs/auth.provider-CejYwjcG.js +2 -0
- package/dist/cjs/auth.provider-CejYwjcG.js.map +1 -0
- package/dist/cjs/cli.js +1 -1
- package/dist/cjs/{index-DB5b_ENM.js → index-Cev20Ede.js} +2 -2
- package/dist/cjs/{index-DB5b_ENM.js.map → index-Cev20Ede.js.map} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{migrate-CelZGq8b.js → migrate-MxrkBSEh.js} +2 -2
- package/dist/cjs/{migrate-CelZGq8b.js.map → migrate-MxrkBSEh.js.map} +1 -1
- package/dist/cjs/package.json +1 -5
- package/dist/cjs/plugin.js +1 -1
- package/dist/cjs/variables-editor-CdUFaTjF.js +106 -0
- package/dist/cjs/variables-editor-CdUFaTjF.js.map +1 -0
- package/dist/cjs/{version-manifest-CWhZ6pMJ.js → version-manifest-DjLJQWWa.js} +2 -2
- package/dist/cjs/{version-manifest-CWhZ6pMJ.js.map → version-manifest-DjLJQWWa.js.map} +1 -1
- package/dist/cjs/{version-plugin-BA18wf3V.js → version-plugin-sUHrN2Jo.js} +2 -2
- package/dist/cjs/{version-plugin-BA18wf3V.js.map → version-plugin-sUHrN2Jo.js.map} +1 -1
- package/dist/client/client.js +67 -14
- package/dist/client/client.js.map +1 -1
- package/dist/esm/{auth.provider-JbhiukCJ.js → auth.provider-BijrVDxp.js} +2 -2
- package/dist/esm/auth.provider-BijrVDxp.js.map +1 -0
- package/dist/esm/cli.js +1 -1
- package/dist/esm/{index-CLZFEGjm.js → index-CL8_j3ER.js} +2 -2
- package/dist/esm/{index-CLZFEGjm.js.map → index-CL8_j3ER.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/{migrate-k56kAk34.js → migrate-B0hgQCl_.js} +2 -2
- package/dist/esm/{migrate-k56kAk34.js.map → migrate-B0hgQCl_.js.map} +1 -1
- package/dist/esm/package.json +1 -5
- package/dist/esm/plugin.js +1 -1
- package/dist/esm/{variables-editor-DejgONni.js → variables-editor-CrhYJD_R.js} +3 -3
- package/dist/esm/variables-editor-CrhYJD_R.js.map +1 -0
- package/dist/esm/{version-manifest-Dwqb65_g.js → version-manifest-1KdgXTW2.js} +2 -2
- package/dist/esm/{version-manifest-Dwqb65_g.js.map → version-manifest-1KdgXTW2.js.map} +1 -1
- package/dist/esm/{version-plugin-DFyZTNxe.js → version-plugin-BExwn1e0.js} +2 -2
- package/dist/esm/{version-plugin-DFyZTNxe.js.map → version-plugin-BExwn1e0.js.map} +1 -1
- package/dist/types/index.d.ts +0 -6
- package/package.json +7 -14
- package/dist/cjs/auth.provider-Co900L4C.js +0 -2
- package/dist/cjs/auth.provider-Co900L4C.js.map +0 -1
- package/dist/cjs/variables-editor-BWjt3zQ-.js +0 -106
- package/dist/cjs/variables-editor-BWjt3zQ-.js.map +0 -1
- package/dist/esm/auth.provider-JbhiukCJ.js.map +0 -1
- package/dist/esm/variables-editor-DejgONni.js.map +0 -1
package/dist/esm/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metricinsights/pp-dev",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.0-beta.
|
|
4
|
+
"version": "1.5.0-beta.18",
|
|
5
5
|
"description": "Portal Page dev build tool",
|
|
6
6
|
"bin": {
|
|
7
7
|
"pp-dev": "bin/pp-dev.js"
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
"axios": "^1.20.0",
|
|
77
77
|
"cac": "^7.1.0",
|
|
78
78
|
"chokidar": "^5.0.0",
|
|
79
|
-
"deepmerge-ts": "^8.0.2",
|
|
80
79
|
"diff-match-patch": "^1.0.5",
|
|
81
80
|
"dir-compare": "^5.0.0",
|
|
82
81
|
"ejs": "^6.0.1",
|
|
@@ -88,16 +87,13 @@
|
|
|
88
87
|
"jsdom": "30.1.3",
|
|
89
88
|
"jszip": "^3.10.2",
|
|
90
89
|
"picocolors": "^1.1.1",
|
|
91
|
-
"rollup": "^4.64.10",
|
|
92
90
|
"sass": "^1.105.2",
|
|
93
91
|
"sharp": "^0.35.5",
|
|
94
92
|
"svgo": "^4.1.0",
|
|
95
93
|
"svgtofont": "^6.5.3",
|
|
96
|
-
"typescript": "^6.0.3",
|
|
97
94
|
"vite": "^8.3.4",
|
|
98
95
|
"vite-plugin-image-optimizer": "^2.0.3",
|
|
99
96
|
"vite-plugin-zip-pack": "^1.2.4",
|
|
100
|
-
"winston": "^3.19.0",
|
|
101
97
|
"ws": "^8.22.0"
|
|
102
98
|
},
|
|
103
99
|
"files": [
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as e,g as s,d as o,R as t,o as r,b as i,I as a,M as l,h as p,j as d,k as c,p as u,q as m,s as g,t as f,v as h,w as k,D as b,C as I,m as P,n as y,U as T,V as w,l as E,u as A,x as S}from"./variables-editor-
|
|
1
|
+
import{f as e,g as s,d as o,R as t,o as r,b as i,I as a,M as l,h as p,j as d,k as c,p as u,q as m,s as g,t as f,v as h,w as k,D as b,C as I,m as P,n as y,U as T,V as w,l as E,u as A,x as S}from"./variables-editor-CrhYJD_R.js";import{a as x}from"./auth.provider-BijrVDxp.js";export{n as normalizePPDevConfig,v as validatePPDevConfig}from"./auth.provider-BijrVDxp.js";import"zlib";import"url";import"axios";import"node:http";import"node:https";import"./version-manifest-1KdgXTW2.js";import"crypto";import"child_process";import"fs/promises";import"path";import"util";import"node:module";import"http-proxy-middleware";import"node:string_decoder";import"node:crypto";import"node:fs";import"node:os";import"node:path";import"express";import"fs";import"process";import"os";import"jszip";import"module";import"picocolors";import"vite";function j(n){const{templateName:v,templateLess:j,backendBaseURL:D,miHudLess:R,appId:L,enableProxyCache:N,proxyCacheTTL:U,disableSSLValidation:F,outDir:$,distZip:_,versionPlugin:B,syncBackupsDir:O,syncMaxBackups:C,syncBuildTimeoutMs:H,v7Features:M,personalAccessToken:W,inspectorEnabled:z,inspectorMaxMemory:V,inspectorCaptureLimit:X,devPanelPosition:Z,devPanelHidden:Y,devPanelAutoHide:q,persistUsers:K}=n||{};let G,J=!0;return{name:"vite-pp-dev",apply:"serve",closeBundle(){G?.dispose(),G=void 0},config:e=>(e.clientInjectionPlugin={backendBaseURL:D,appId:L,templateLess:j,v7Features:M,devPanelPosition:Z,devPanelHidden:Y,devPanelAutoHide:q},M&&(e.base=`/pl/${v}`),e),transformIndexHtml:async(e,s)=>{const o={html:e,tags:[]};return J&&(J=!1,o.tags.push({tag:"script",injectTo:"body",children:`${Math.random()}`})),o},configureServer:Z=>{let Y=Z.config.base;Y.endsWith("/")||(Y+="/");const q=Y.substring(0,Y.lastIndexOf("/"));if(D&&Z.middlewares.use(e()),Z.middlewares.use(s(Y,v)),!1!==z){const e=new t(V);Z.middlewares.use(o(e,X));const s=r();i(s,e,X),Z.middlewares.use((e,o,t)=>{e.url?.startsWith("/@api/")||e.url?.startsWith(a)?s(e,o,t):t()})}if(D){Z.config.logger.info(x.blue(`🌐 Backend URL: ${D}`)),Z.config.logger.info(x.blue(`🆔 Custom App ID: ${L}`));const e=new URL(D).host,s={headers:{host:e,referer:D,origin:D.replace(/^(https?:\/\/)([^/]+)(\/.*)?$/i,"$1$2")},appId:L,templateLess:j,disableSSLValidation:F,v7Features:M,personalAccessToken:W??process.env.MI_ACCESS_TOKEN},o=new l(D,s);if(N){let e=+U;(!e||Number.isNaN(e)||e<0)&&(e=6e5),Z.middlewares.use(p({devServer:Z,ttl:e}))}const t=new RegExp(`^((${Y})|/)$`);Z.middlewares.use(d(t,o,Object.assign({},n,{appId:L,appBase:Y}))),Z.middlewares.use(c({baseURL:D,proxyIgnore:["/@vite","/@metricinsights","/@",q],disableSSLValidation:F,miAPI:o,templateName:v}));const i=(e,s,o,t,r)=>{const i={error:o};t&&(i.details=t),r&&(i.code=r),e.status(s).json(i).end()},a=(e,s,o)=>{Z.config.logger.error(`${o} token validation error:`,s);const t=S(s);if(s.tokenErrorInfo){const o=s.tokenErrorInfo;i(e,o.status||500,o.userFriendlyMessage,o.message,o.code)}else{let s,r,a;switch(t.code){case"SESSION_EXPIRED":s=412,r="personal"===o?"Personal access token expired":"Session expired",a="personal"===o?"PAT_EXPIRED":"SESSION_EXPIRED";break;case"UNAUTHORIZED":s=401,r="Unauthorized",a="UNAUTHORIZED";break;case"FORBIDDEN":s=403,r="Access forbidden",a="FORBIDDEN";break;default:s=500,r="Internal server error",a=t.code}const n="personal"===o&&"PAT_EXPIRED"===a?"Your personal access token has expired. Please generate a new token from the portal.":"regular"===o&&"SESSION_EXPIRED"===a?"Your portal session has expired. Please refresh your token or re-authenticate.":t.userFriendlyMessage;i(e,s,r,n,a)}return null},z=r();z.post("/@api/login",async(e,s,t)=>{const{token:r,tokenType:n}=e.body;if(u(e.headers.host))i(s,409,"Token login is only available on the main host","This tab belongs to a saved pp-dev user. Log in with a token on the main host (localhost).","USER_HOST");else if(r)if(Z.config.logger.info(`Attempting to validate ${n} token...`),"personal"===n){if(!await o.get("/data/page/index/auth/info",{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${r}`},!0).then(async e=>"number"==typeof e.data?.user?.user_id?(o.personalAccessToken=r,Z.config.logger.info(`Personal access token validated successfully for user ${e.data.user.user_id}`),e):(i(s,400,"Token expired or invalid"),null)).catch(e=>a(s,e,"personal")))return;m("logged in with a personal access token"),g({persist:K,miAPI:o,projectRoot:Z.config.root||process.cwd(),miUrl:D}),f(s,"/",302)}else if("regular"===n){if(!await o.get("/api/user",{"Content-Type":"application/json",Accept:"application/json",Token:r},!0).then(t=>t.data?.users?.length?(o.personalAccessToken=void 0,Z.config.logger.info(`Regular token validated successfully for ${t.data.users.length} user(s)`),s.setHeader("set-cookie",h(t.headers["set-cookie"],k(e))??""),t):(i(s,400,"Token expired or invalid"),null)).catch(e=>a(s,e,"regular")))return;m("logged in with a token"),f(s,"/",302)}else i(s,400,"Invalid tokenType",'tokenType must be "personal" or "regular".',"INVALID_TOKEN_TYPE");else i(s,400,"Token is required")});const V=new b(v,Object.assign({root:Z.config.root,backupFolder:O,maxBackups:C,buildTimeoutMs:H,buildInputFolder:"object"==typeof _?_.inDir??$:$},"object"==typeof _?{distZipFolder:_.outDir,distZipFilename:_.outFileName}:void 0,"object"==typeof B?{versionFileTemplate:B.versionFileTemplate}:void 0));return G=new I(Z,{distService:V,miAPI:o}),P(z,{distService:V,miAPI:o}),y(z,{miAPI:o}),g({persist:K,miAPI:o,projectRoot:Z.config.root||process.cwd(),miUrl:D}),Z.middlewares.use((e,s,o)=>{e.url?.startsWith("/@api/login")||e.url?.startsWith("/@api/variables/")||e.url?.startsWith(T)||e.url?.startsWith(w)?z(e,s,o):o()}),()=>{Z.middlewares.use(E(e=>e.split("?")[0].endsWith("index.html"),(s,t)=>Buffer.from(A(e,t.headers.host??"",o.buildPage(s,R)))))}}}}}export{j as default,j as vitePPDev};
|
|
2
2
|
//# sourceMappingURL=plugin.js.map
|