prismic 1.7.0 → 1.7.1

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.
@@ -0,0 +1 @@
1
+ var e=`prismic`,t=`1.7.1`;export{t as n,e as t};
@@ -1 +1 @@
1
- import{n as e,t}from"./package-D7f_4PH5.mjs";import{n}from"./env-DbZx_TgQ.mjs";import{readFile as r}from"node:fs/promises";import{fileURLToPath as i}from"node:url";import{randomUUID as a}from"node:crypto";import{join as o}from"node:path";import{spawn as s}from"node:child_process";import{homedir as c}from"node:os";const l=process.env.PRISMIC_ENV&&process.env.PRISMIC_ENV!==`production`?`Ng5oKJHCGpSWplZ9ymB7Pu7rm0sTDeiG`:`cGjidifKefYb6EPaGaqpt8rQXkv5TD6P`;let u=!1,d=``,f,p;const m={app:{name:t,version:e}},h=[],g=[];async function _(){try{if(n.TEST||(u=await T(),!u))return;d=a(),process.on(`exit`,C)}catch{u=!1}}function v(e,t={}){if(!u)return;let{repository:n=p,watch:r}=t,i={commandType:e,fullCommand:process.argv.join(` `)};n&&(i.repository=n),r!==void 0&&(i.watch=r),h.push({event:`Prismic CLI Start`,properties:i,context:S(n)})}function y(e,t={}){if(!u)return;let{success:n=!process.exitCode,error:r,repository:i=p,watch:a}=t,o={commandType:e,fullCommand:process.argv.join(` `),success:n};i&&(o.repository=i),a!==void 0&&(o.watch=a),r!==void 0&&(o.error=(r instanceof Error?r.message:String(r)).slice(0,512)),h.push({event:`Prismic CLI End`,properties:o,context:S(i)})}function b(e){u&&(f=e.shortId,g.push({userId:f,anonymousId:d,integrations:{Intercom:{user_hash:e.intercomHash}},context:m,timestamp:new Date().toISOString()}))}function x(e){p=e}function S(e){let t={...m};return e&&(t.groupId={Repository:e}),t}function C(){if(!(h.length===0&&g.length===0)){try{let e=Buffer.from(JSON.stringify({trackEvents:h.map(e=>({...f?{userId:f}:{},anonymousId:d,event:e.event,properties:{nodeVersion:process.versions.node,...e.properties},context:e.context,timestamp:new Date().toISOString()})),identifyEvents:g})).toString(`base64`),t=i(new URL(`./subprocesses/sendSegmentEvents.mjs`,import.meta.url));s(process.execPath,[t,e],{detached:!0,stdio:`ignore`}).unref()}catch{}h.length=0,g.length=0}}async function w(e,t){let n={"Content-Type":`application/json`,Authorization:`Basic ${btoa(l+`:`)}`};await Promise.allSettled([...e.map(e=>fetch(`https://api.segment.io/v1/track`,{method:`POST`,headers:n,body:JSON.stringify(e)}).catch(()=>{})),...t.map(e=>fetch(`https://api.segment.io/v1/identify`,{method:`POST`,headers:n,body:JSON.stringify(e)}).catch(()=>{}))])}async function T(){try{return!((await E(o(c(),`.prismicrc`)))?.telemetry===!1||(await E(o(process.cwd(),`.prismicrc`)))?.telemetry===!1)}catch{return!0}}async function E(e){try{let t=await r(e,`utf8`);return JSON.parse(t)}catch{return}}export{v as a,y as i,b as n,w as o,x as r,_ as t};
1
+ import{n as e,t}from"./package-DdAnd1UD.mjs";import{n}from"./env-DbZx_TgQ.mjs";import{readFile as r}from"node:fs/promises";import{fileURLToPath as i}from"node:url";import{randomUUID as a}from"node:crypto";import{join as o}from"node:path";import{spawn as s}from"node:child_process";import{homedir as c}from"node:os";const l=process.env.PRISMIC_ENV&&process.env.PRISMIC_ENV!==`production`?`Ng5oKJHCGpSWplZ9ymB7Pu7rm0sTDeiG`:`cGjidifKefYb6EPaGaqpt8rQXkv5TD6P`;let u=!1,d=``,f,p;const m={app:{name:t,version:e}},h=[],g=[];async function _(){try{if(n.TEST||(u=await T(),!u))return;d=a(),process.on(`exit`,C)}catch{u=!1}}function v(e,t={}){if(!u)return;let{repository:n=p,watch:r}=t,i={commandType:e,fullCommand:process.argv.join(` `)};n&&(i.repository=n),r!==void 0&&(i.watch=r),h.push({event:`Prismic CLI Start`,properties:i,context:S(n)})}function y(e,t={}){if(!u)return;let{success:n=!process.exitCode,error:r,repository:i=p,watch:a}=t,o={commandType:e,fullCommand:process.argv.join(` `),success:n};i&&(o.repository=i),a!==void 0&&(o.watch=a),r!==void 0&&(o.error=(r instanceof Error?r.message:String(r)).slice(0,512)),h.push({event:`Prismic CLI End`,properties:o,context:S(i)})}function b(e){u&&(f=e.shortId,g.push({userId:f,anonymousId:d,integrations:{Intercom:{user_hash:e.intercomHash}},context:m,timestamp:new Date().toISOString()}))}function x(e){p=e}function S(e){let t={...m};return e&&(t.groupId={Repository:e}),t}function C(){if(!(h.length===0&&g.length===0)){try{let e=Buffer.from(JSON.stringify({trackEvents:h.map(e=>({...f?{userId:f}:{},anonymousId:d,event:e.event,properties:{nodeVersion:process.versions.node,...e.properties},context:e.context,timestamp:new Date().toISOString()})),identifyEvents:g})).toString(`base64`),t=i(new URL(`./subprocesses/sendSegmentEvents.mjs`,import.meta.url));s(process.execPath,[t,e],{detached:!0,stdio:`ignore`}).unref()}catch{}h.length=0,g.length=0}}async function w(e,t){let n={"Content-Type":`application/json`,Authorization:`Basic ${btoa(l+`:`)}`};await Promise.allSettled([...e.map(e=>fetch(`https://api.segment.io/v1/track`,{method:`POST`,headers:n,body:JSON.stringify(e)}).catch(()=>{})),...t.map(e=>fetch(`https://api.segment.io/v1/identify`,{method:`POST`,headers:n,body:JSON.stringify(e)}).catch(()=>{}))])}async function T(){try{return!((await E(o(c(),`.prismicrc`)))?.telemetry===!1||(await E(o(process.cwd(),`.prismicrc`)))?.telemetry===!1)}catch{return!0}}async function E(e){try{let t=await r(e,`utf8`);return JSON.parse(t)}catch{return}}export{v as a,y as i,b as n,w as o,x as r,_ as t};
@@ -1 +1 @@
1
- import"../env-DbZx_TgQ.mjs";import{o as e}from"../segment-B4aDWMdC.mjs";const{trackEvents:t,identifyEvents:n}=JSON.parse(Buffer.from(process.argv[2],`base64`).toString());try{await e(t,n)}catch{}export{};
1
+ import"../env-DbZx_TgQ.mjs";import{o as e}from"../segment-dg1LJ1rm.mjs";const{trackEvents:t,identifyEvents:n}=JSON.parse(Buffer.from(process.argv[2],`base64`).toString());try{await e(t,n)}catch{}export{};
@@ -1 +1 @@
1
- import"../packageJson-BNFJTFZF.mjs";import{n as e}from"../update-notifier-zw3PKsIt.mjs";const[t,n]=process.argv.slice(2);try{await e(t,new URL(n))}catch{}export{};
1
+ import"../packageJson-BNFJTFZF.mjs";import{n as e}from"../update-notifier-BoGbRmc9.mjs";const[t,n]=process.argv.slice(2);try{await e(t,new URL(n))}catch{}export{};
@@ -1 +1 @@
1
- import{n as e}from"./package-D7f_4PH5.mjs";import{_ as t,d as n,l as r,p as i,s as a}from"./schemas-CyhgtjZl.mjs";import{o}from"./request-DClMWmnH.mjs";import{i as s}from"./packageJson-BNFJTFZF.mjs";import{mkdir as c,readFile as l,writeFile as u}from"node:fs/promises";import{fileURLToPath as d}from"node:url";import{dirname as f}from"node:path";import{spawn as p}from"node:child_process";const m=a({latestKnownVersion:n(i()),lastUpdateCheckAt:n(r())});async function h(t){try{if(g())return;let n=await _(t.statePath),r=e;if(n?.latestKnownVersion&&v(n.latestKnownVersion,r)){let e=`Update available: ${r} → ${n.latestKnownVersion}. Run \`npx ${t.npmPackageName}@latest --version\` to update.`;process.on(`exit`,()=>{try{console.error(`\n${e}`)}catch{}})}(!n?.lastUpdateCheckAt||Date.now()-n.lastUpdateCheckAt>864e5)&&process.on(`exit`,()=>{b(t.npmPackageName,t.statePath)})}catch{}}function g(){return process.env.NO_UPDATE_NOTIFIER===`0`?!1:!!(process.env.NO_UPDATE_NOTIFIER===`1`||process.env.CI||!process.stderr.isTTY)}async function _(e){try{let n=await l(e,`utf-8`);return t(m,JSON.parse(n))}catch{return}}function v(e,t){if(e.includes(`-`)||t.includes(`-`))return!1;let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);if(n.length!==3||r.length!==3||n.some(e=>!Number.isFinite(e))||r.some(e=>!Number.isFinite(e)))return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}async function y(e,t){let n=await s(e),r=d(t);await c(f(r),{recursive:!0}),await u(r,o({latestKnownVersion:n,lastUpdateCheckAt:Date.now()}))}function b(e,t){try{let n=d(new URL(`./subprocesses/updateVersionState.mjs`,import.meta.url));p(process.execPath,[n,e,t.href],{detached:!0,stdio:`ignore`}).unref()}catch{}}export{y as n,h as t};
1
+ import{n as e}from"./package-DdAnd1UD.mjs";import{_ as t,d as n,l as r,p as i,s as a}from"./schemas-CyhgtjZl.mjs";import{o}from"./request-DClMWmnH.mjs";import{i as s}from"./packageJson-BNFJTFZF.mjs";import{mkdir as c,readFile as l,writeFile as u}from"node:fs/promises";import{fileURLToPath as d}from"node:url";import{dirname as f}from"node:path";import{spawn as p}from"node:child_process";const m=a({latestKnownVersion:n(i()),lastUpdateCheckAt:n(r())});async function h(t){try{if(g())return;let n=await _(t.statePath),r=e;if(n?.latestKnownVersion&&v(n.latestKnownVersion,r)){let e=`Update available: ${r} → ${n.latestKnownVersion}. Run \`npx ${t.npmPackageName}@latest --version\` to update.`;process.on(`exit`,()=>{try{console.error(`\n${e}`)}catch{}})}(!n?.lastUpdateCheckAt||Date.now()-n.lastUpdateCheckAt>864e5)&&process.on(`exit`,()=>{b(t.npmPackageName,t.statePath)})}catch{}}function g(){return process.env.NO_UPDATE_NOTIFIER===`0`?!1:!!(process.env.NO_UPDATE_NOTIFIER===`1`||process.env.CI||!process.stderr.isTTY)}async function _(e){try{let n=await l(e,`utf-8`);return t(m,JSON.parse(n))}catch{return}}function v(e,t){if(e.includes(`-`)||t.includes(`-`))return!1;let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);if(n.length!==3||r.length!==3||n.some(e=>!Number.isFinite(e))||r.some(e=>!Number.isFinite(e)))return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}async function y(e,t){let n=await s(e),r=d(t);await c(f(r),{recursive:!0}),await u(r,o({latestKnownVersion:n,lastUpdateCheckAt:Date.now()}))}function b(e,t){try{let n=d(new URL(`./subprocesses/updateVersionState.mjs`,import.meta.url));p(process.execPath,[n,e,t.href],{detached:!0,stdio:`ignore`}).unref()}catch{}}export{y as n,h as t};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prismic",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Prismic's official command line tool",
5
5
  "keywords": [
6
6
  "prismic",
@@ -1 +0,0 @@
1
- var e=`prismic`,t=`1.7.0`;export{t as n,e as t};