@griddo/cx 10.6.1 → 10.6.3

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.
@@ -23,7 +23,7 @@ GFS4: `),console.error(e)});H[K]||(ua=global[K]||[],fa(H,ua),H.close=function(e)
23
23
  \u2502 Access credentials failure \u2502
24
24
  \u2502 Check that the login details are correct in your .env file \u2502
25
25
  \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F
26
- `)),process.exit(1)}}},dr=new In;var ml=$(pr());var hl=$(An()),dl=$(hr()),pl=$(pr());var ol=$(require("node:crypto")),Br=$(require("node:fs")),Si=$(require("node:path")),al=$(qt());var Tp=$(hr()),rl=$(pr()),qp=$(qt()),Fp=$(Yu()),nl=$(mt());var xp=$(qt());var Sp=$(qt());var B1=ze();var X1=ze();rl.default.config();var iy=ze(),sy=il(process.env.GRIDDO_DEBUG_LOGS),Ip=il(process.env.GRIDDO_BUILD_LOGS),oy=nl.default.sync(),ay={clean:JSON.parse(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS||"1"),prepare:JSON.parse(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS||"1"),restore:JSON.parse(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS||"1"),data:JSON.parse(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS||"1"),ssg:JSON.parse(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS||"2"),relocation:JSON.parse(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS||"1"),meta:JSON.parse(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS||"4"),archive:JSON.parse(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS||"1")};function ze(){try{return(tl(),Ri(el)).default}catch{console.log("Error while reading configuration file"),process.exit(1)}}function il(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(e.toLowerCase()==="true")return!0;if(e.toLowerCase()==="false")return!1;if(e.toLowerCase()==="on")return!0;if(e.toLowerCase()==="off")return!1;let t=parseInt(e,10);return isNaN(t)?!1:t>0}function vi(e){Ip&&console.info(e.replace(/(\s)\s+/g,"$1").trim())}function sl(e){return new Promise(t=>setTimeout(t,e))}function bi(e,t=3){return(e/1e3).toFixed(t)}function wi(e){return"site"in e&&e.site?e?.site:void 0}var Dp=ze();function cl(e){let{__cx:t}=Dp.paths(),r=Si.default.join(t,"apiCache"),n=ol.default.createHash("sha256");return n.update(JSON.stringify(e)),`${r}/${n.digest("hex")}`}function ul(e,t){let r=typeof t=="string"?t:JSON.stringify(t),n=cl(e),i=Si.default.dirname(n);Br.default.existsSync(i)||Br.default.mkdirSync(i,{recursive:!0}),Br.default.writeFileSync(n,r,"utf8")}function ll(e){try{let t=cl(e);return al.default.readJSONSync(t,{encoding:"utf-8"})}catch{return null}}pl.default.config();var{env:{RETRY_WAIT_SECONDS:Np="4",RETRY_ATTEMPTS:fl="4"}}=process;async function xi(e,t,r=""){let{endpoint:n,body:i,cacheKey:s="",attempt:o=1,headers:a}=e,c={endpoint:n,body:i,headers:a,cacheKey:s};if(s){let d=new Date,f=ll(c);if(f){let p=wi(f),y=p?`site: ${p}`:"",m=bi(new Date().getTime()-d.getTime());return vi(`${t} (cache) ${y} ${n} - ${m}s ${r}`),f}}try{let d=new Date,{data:f}=await(0,hl.default)({url:n,method:t,headers:Object.assign({},a,dr.headers),data:i}),p=wi(f),y=p?`site: ${p}`:"",m=bi(new Date().getTime()-d.getTime());return vi(`${t} (fetch) ${y} ${n} - ${m}s ${r}`),ul(c,f),f}catch(d){let f=d;return f.response?.status===404?null:(o>parseInt(fl)&&(console.log(`
26
+ `)),process.exit(1)}}},dr=new In;var ml=$(pr());var hl=$(An()),dl=$(hr()),pl=$(pr());var ol=$(require("node:crypto")),Br=$(require("node:fs")),Si=$(require("node:path")),al=$(qt());var Tp=$(hr()),rl=$(pr()),qp=$(qt()),Fp=$(Yu()),nl=$(mt());var xp=$(qt());var Sp=$(qt());var B1=ze();var X1=ze();rl.default.config();var iy=ze(),sy=il(process.env.GRIDDO_DEBUG_LOGS),Ip=il(process.env.GRIDDO_BUILD_LOGS),oy=nl.default.sync(),ay={clean:JSON.parse(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS||"1"),prepare:JSON.parse(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS||"1"),restore:JSON.parse(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS||"1"),data:JSON.parse(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS||"1"),ssg:JSON.parse(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS||"2"),relocation:JSON.parse(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS||"1"),meta:JSON.parse(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS||"4"),archive:JSON.parse(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS||"1")};function ze(){try{return(tl(),Ri(el)).default}catch{console.log("Error while reading configuration file"),process.exit(1)}}function il(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(e.toLowerCase()==="true")return!0;if(e.toLowerCase()==="false")return!1;if(e.toLowerCase()==="on")return!0;if(e.toLowerCase()==="off")return!1;let t=parseInt(e,10);return isNaN(t)?!1:t>0}function vi(e){Ip&&console.info(e.replace(/(\s)\s+/g,"$1").trim())}function sl(e){return new Promise(t=>setTimeout(t,e))}function bi(e,t=3){return(e/1e3).toFixed(t)}function wi(e){if(typeof e!="string")return"site"in e&&e.site?e?.site:void 0}var Dp=ze();function cl(e){let{__cx:t}=Dp.paths(),r=Si.default.join(t,"apiCache"),n=ol.default.createHash("sha256");return n.update(JSON.stringify(e)),`${r}/${n.digest("hex")}`}function ul(e,t){let r=typeof t=="string"?t:JSON.stringify(t),n=cl(e),i=Si.default.dirname(n);Br.default.existsSync(i)||Br.default.mkdirSync(i,{recursive:!0}),Br.default.writeFileSync(n,r,"utf8")}function ll(e){try{let t=cl(e);return al.default.readJSONSync(t,{encoding:"utf-8"})}catch{return null}}pl.default.config();var{env:{RETRY_WAIT_SECONDS:Np="4",RETRY_ATTEMPTS:fl="4"}}=process;async function xi(e,t,r=""){let{endpoint:n,body:i,cacheKey:s="",attempt:o=1,headers:a}=e,c={endpoint:n,body:i,headers:a,cacheKey:s};if(s){let d=new Date,f=ll(c);if(f){let p=wi(f),y=p?`site: ${p}`:"",m=bi(new Date().getTime()-d.getTime());return vi(`${t} (cache) ${y} ${n} - ${m}s ${r}`),f}}try{let d=new Date,{data:f}=await(0,hl.default)({url:n,method:t,headers:Object.assign({},a,dr.headers),data:i}),p=wi(f),y=p?`site: ${p}`:"",m=bi(new Date().getTime()-d.getTime());return vi(`${t} (fetch) ${y} ${n} - ${m}s ${r}`),ul(c,f),f}catch(d){let f=d;return f.response?.status===404?null:(o>parseInt(fl)&&(console.log(`
27
27
  Max attempts ${fl} reached
28
28
  --------------------------------------
29
29
  - ${t.toUpperCase()} ${n}
package/build/index.js CHANGED
@@ -23,7 +23,7 @@ GFS4: `),console.error(t)});J[ie]||(la=global[ie]||[],da(J,la),J.close=function(
23
23
  `).map(b=>b.trim()),o=e?` ${e} `:"",s=e?o.length:0,a=Math.max(...i.map(b=>b.length))+r*2,c=Math.max(a,s),d=`\u2502${" ".repeat(c)}\u2502
24
24
  `.repeat(n),u=c,p=`\u256D${o}${"\u2500".repeat(u-s)}\u256E
25
25
  `,g=`\u2570${"\u2500".repeat(u)}\u256F`,m=i.map(b=>{let w=" ".repeat(c-b.length-r);return`\u2502${" ".repeat(r)}${b}${w}\u2502
26
- `}).join("");console.log(`${p}${d}${m}${d}${g}`)}function et(t){Kg&&console.info(t.replace(/(\s)\s+/g,"$1").trim())}function pf(t){return new Promise(e=>setTimeout(e,t))}function mf(t,e="KB"){let r={low:50,mid:80,large:130,extraLarge:210},n=t>r.large?"red":t>r.mid?"magenta":t>r.low?"blue":"green";return ht.default[n].bold(`${t}${e}`)}function So(t,e=3){return(t/1e3).toFixed(e)}function xo(t){return"site"in t&&t.site?t?.site:void 0}function mo(t,e){for(let r in t)e.includes(r)?delete t[r]:typeof t[r]=="object"&&mo(t[r],e)}function Eo(t){return t.map(({name:e,id:r})=>`${e} (${r})`).join(", ")}function gf(t){let e=process.version,{griddoVersion:r}=df,n=`
26
+ `}).join("");console.log(`${p}${d}${m}${d}${g}`)}function et(t){Kg&&console.info(t.replace(/(\s)\s+/g,"$1").trim())}function pf(t){return new Promise(e=>setTimeout(e,t))}function mf(t,e="KB"){let r={low:50,mid:80,large:130,extraLarge:210},n=t>r.large?"red":t>r.mid?"magenta":t>r.low?"blue":"green";return ht.default[n].bold(`${t}${e}`)}function So(t,e=3){return(t/1e3).toFixed(e)}function xo(t){if(typeof t!="string")return"site"in t&&t.site?t?.site:void 0}function mo(t,e){for(let r in t)e.includes(r)?delete t[r]:typeof t[r]=="object"&&mo(t[r],e)}function Eo(t){return t.map(({name:e,id:r})=>`${e} (${r})`).join(", ")}function gf(t){let e=process.version,{griddoVersion:r}=df,n=`
27
27
  \xB7\xB7
28
28
  \xB7\xB7 Griddo Exporter ${r}
29
29
  \xB7\xB7 Adapter: ${t}
@@ -23,7 +23,7 @@ GFS4: `),console.error(e)});H[K]||(No=global[K]||[],jo(H,No),H.close=function(e)
23
23
  \u2502 Access credentials failure \u2502
24
24
  \u2502 Check that the login details are correct in your .env file \u2502
25
25
  \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F
26
- `)),process.exit(1)}}},or=new Sn;var nl=J(mn()),il=J(sr()),sl=J(En());var Ku=J(require("node:crypto")),Dr=J(require("node:fs")),mi=J(require("node:path")),Qu=J(Pt());var _p=J(sr()),Wu=J(En()),Cp=J(Pt()),kp=J(xu()),Vu=J(Fr());var pp=J(Pt());var dp=J(Pt());var P1=He();var j1=He();Wu.default.config();var J1=He(),W1=Xu(process.env.GRIDDO_DEBUG_LOGS),Op=Xu(process.env.GRIDDO_BUILD_LOGS),V1=Vu.default.sync(),X1={clean:JSON.parse(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS||"1"),prepare:JSON.parse(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS||"1"),restore:JSON.parse(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS||"1"),data:JSON.parse(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS||"1"),ssg:JSON.parse(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS||"2"),relocation:JSON.parse(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS||"1"),meta:JSON.parse(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS||"4"),archive:JSON.parse(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS||"1")};function He(){try{return(Ju(),ml(zu)).default}catch{console.log("Error while reading configuration file"),process.exit(1)}}function Xu(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(e.toLowerCase()==="true")return!0;if(e.toLowerCase()==="false")return!1;if(e.toLowerCase()==="on")return!0;if(e.toLowerCase()==="off")return!1;let t=parseInt(e,10);return isNaN(t)?!1:t>0}function hi(e){Op&&console.info(e.replace(/(\s)\s+/g,"$1").trim())}function Yu(e){return new Promise(t=>setTimeout(t,e))}function di(e,t=3){return(e/1e3).toFixed(t)}function pi(e){return"site"in e&&e.site?e?.site:void 0}var Rp=He();function Zu(e){let{__cx:t}=Rp.paths(),r=mi.default.join(t,"apiCache"),n=Ku.default.createHash("sha256");return n.update(JSON.stringify(e)),`${r}/${n.digest("hex")}`}function el(e,t){let r=typeof t=="string"?t:JSON.stringify(t),n=Zu(e),i=mi.default.dirname(n);Dr.default.existsSync(i)||Dr.default.mkdirSync(i,{recursive:!0}),Dr.default.writeFileSync(n,r,"utf8")}function tl(e){try{let t=Zu(e);return Qu.default.readJSONSync(t,{encoding:"utf-8"})}catch{return null}}sl.default.config();var{env:{RETRY_WAIT_SECONDS:Pp="4",RETRY_ATTEMPTS:rl="4"}}=process;async function yi(e,t,r=""){let{endpoint:n,body:i,cacheKey:s="",attempt:o=1,headers:a}=e,c={endpoint:n,body:i,headers:a,cacheKey:s};if(s){let d=new Date,f=tl(c);if(f){let p=pi(f),y=p?`site: ${p}`:"",m=di(new Date().getTime()-d.getTime());return hi(`${t} (cache) ${y} ${n} - ${m}s ${r}`),f}}try{let d=new Date,{data:f}=await(0,nl.default)({url:n,method:t,headers:Object.assign({},a,or.headers),data:i}),p=pi(f),y=p?`site: ${p}`:"",m=di(new Date().getTime()-d.getTime());return hi(`${t} (fetch) ${y} ${n} - ${m}s ${r}`),el(c,f),f}catch(d){let f=d;return f.response?.status===404?null:(o>parseInt(rl)&&(console.log(`
26
+ `)),process.exit(1)}}},or=new Sn;var nl=J(mn()),il=J(sr()),sl=J(En());var Ku=J(require("node:crypto")),Dr=J(require("node:fs")),mi=J(require("node:path")),Qu=J(Pt());var _p=J(sr()),Wu=J(En()),Cp=J(Pt()),kp=J(xu()),Vu=J(Fr());var pp=J(Pt());var dp=J(Pt());var P1=He();var j1=He();Wu.default.config();var J1=He(),W1=Xu(process.env.GRIDDO_DEBUG_LOGS),Op=Xu(process.env.GRIDDO_BUILD_LOGS),V1=Vu.default.sync(),X1={clean:JSON.parse(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS||"1"),prepare:JSON.parse(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS||"1"),restore:JSON.parse(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS||"1"),data:JSON.parse(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS||"1"),ssg:JSON.parse(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS||"2"),relocation:JSON.parse(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS||"1"),meta:JSON.parse(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS||"4"),archive:JSON.parse(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS||"1")};function He(){try{return(Ju(),ml(zu)).default}catch{console.log("Error while reading configuration file"),process.exit(1)}}function Xu(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(e.toLowerCase()==="true")return!0;if(e.toLowerCase()==="false")return!1;if(e.toLowerCase()==="on")return!0;if(e.toLowerCase()==="off")return!1;let t=parseInt(e,10);return isNaN(t)?!1:t>0}function hi(e){Op&&console.info(e.replace(/(\s)\s+/g,"$1").trim())}function Yu(e){return new Promise(t=>setTimeout(t,e))}function di(e,t=3){return(e/1e3).toFixed(t)}function pi(e){if(typeof e!="string")return"site"in e&&e.site?e?.site:void 0}var Rp=He();function Zu(e){let{__cx:t}=Rp.paths(),r=mi.default.join(t,"apiCache"),n=Ku.default.createHash("sha256");return n.update(JSON.stringify(e)),`${r}/${n.digest("hex")}`}function el(e,t){let r=typeof t=="string"?t:JSON.stringify(t),n=Zu(e),i=mi.default.dirname(n);Dr.default.existsSync(i)||Dr.default.mkdirSync(i,{recursive:!0}),Dr.default.writeFileSync(n,r,"utf8")}function tl(e){try{let t=Zu(e);return Qu.default.readJSONSync(t,{encoding:"utf-8"})}catch{return null}}sl.default.config();var{env:{RETRY_WAIT_SECONDS:Pp="4",RETRY_ATTEMPTS:rl="4"}}=process;async function yi(e,t,r=""){let{endpoint:n,body:i,cacheKey:s="",attempt:o=1,headers:a}=e,c={endpoint:n,body:i,headers:a,cacheKey:s};if(s){let d=new Date,f=tl(c);if(f){let p=pi(f),y=p?`site: ${p}`:"",m=di(new Date().getTime()-d.getTime());return hi(`${t} (cache) ${y} ${n} - ${m}s ${r}`),f}}try{let d=new Date,{data:f}=await(0,nl.default)({url:n,method:t,headers:Object.assign({},a,or.headers),data:i}),p=pi(f),y=p?`site: ${p}`:"",m=di(new Date().getTime()-d.getTime());return hi(`${t} (fetch) ${y} ${n} - ${m}s ${r}`),el(c,f),f}catch(d){let f=d;return f.response?.status===404?null:(o>parseInt(rl)&&(console.log(`
27
27
  Max attempts ${rl} reached
28
28
  --------------------------------------
29
29
  - ${t.toUpperCase()} ${n}
@@ -23,7 +23,7 @@ GFS4: `),console.error(t)});J[ie]||(ia=global[ie]||[],oa(J,ia),J.close=function(
23
23
  `).map(b=>b.trim()),s=e?` ${e} `:"",o=e?s.length:0,a=Math.max(...i.map(b=>b.length))+r*2,c=Math.max(a,o),d=`\u2502${" ".repeat(c)}\u2502
24
24
  `.repeat(n),u=c,p=`\u256D${s}${"\u2500".repeat(u-o)}\u256E
25
25
  `,g=`\u2570${"\u2500".repeat(u)}\u256F`,m=i.map(b=>{let w=" ".repeat(c-b.length-r);return`\u2502${" ".repeat(r)}${b}${w}\u2502
26
- `}).join("");console.log(`${p}${d}${m}${d}${g}`)}function _t(t){Wg&&console.info(t.replace(/(\s)\s+/g,"$1").trim())}function af(t){return new Promise(e=>setTimeout(e,t))}function ys(t,e=3){return(t/1e3).toFixed(e)}function vs(t){return"site"in t&&t.site?t?.site:void 0}function ds(t,e){for(let r in t)e.includes(r)?delete t[r]:typeof t[r]=="object"&&ds(t[r],e)}function bs(t){return t.map(({name:e,id:r})=>`${e} (${r})`).join(", ")}function cf(t){let e=process.version,{griddoVersion:r}=sf,n=`
26
+ `}).join("");console.log(`${p}${d}${m}${d}${g}`)}function _t(t){Wg&&console.info(t.replace(/(\s)\s+/g,"$1").trim())}function af(t){return new Promise(e=>setTimeout(e,t))}function ys(t,e=3){return(t/1e3).toFixed(e)}function vs(t){if(typeof t!="string")return"site"in t&&t.site?t?.site:void 0}function ds(t,e){for(let r in t)e.includes(r)?delete t[r]:typeof t[r]=="object"&&ds(t[r],e)}function bs(t){return t.map(({name:e,id:r})=>`${e} (${r})`).join(", ")}function cf(t){let e=process.version,{griddoVersion:r}=sf,n=`
27
27
  \xB7\xB7
28
28
  \xB7\xB7 Griddo Exporter ${r}
29
29
  \xB7\xB7 Adapter: ${t}
@@ -24,7 +24,7 @@ GFS4: `),console.error(t)});J[ie]||(oa=global[ie]||[],ca(J,oa),J.close=function(
24
24
  `).map(b=>b.trim()),s=e?` ${e} `:"",o=e?s.length:0,a=Math.max(...i.map(b=>b.length))+r*2,c=Math.max(a,o),d=`\u2502${" ".repeat(c)}\u2502
25
25
  `.repeat(n),u=c,p=`\u256D${s}${"\u2500".repeat(u-o)}\u256E
26
26
  `,g=`\u2570${"\u2500".repeat(u)}\u256F`,m=i.map(b=>{let w=" ".repeat(c-b.length-r);return`\u2502${" ".repeat(r)}${b}${w}\u2502
27
- `}).join("");console.log(`${p}${d}${m}${d}${g}`)}function _t(t){zg&&console.info(t.replace(/(\s)\s+/g,"$1").trim())}function uf(t){return new Promise(e=>setTimeout(e,t))}function ys(t,e=3){return(t/1e3).toFixed(e)}function vs(t){return"site"in t&&t.site?t?.site:void 0}function ds(t,e){for(let r in t)e.includes(r)?delete t[r]:typeof t[r]=="object"&&ds(t[r],e)}function bs(t){return t.map(({name:e,id:r})=>`${e} (${r})`).join(", ")}function lf(t){let e=process.version,{griddoVersion:r}=af,n=`
27
+ `}).join("");console.log(`${p}${d}${m}${d}${g}`)}function _t(t){zg&&console.info(t.replace(/(\s)\s+/g,"$1").trim())}function uf(t){return new Promise(e=>setTimeout(e,t))}function ys(t,e=3){return(t/1e3).toFixed(e)}function vs(t){if(typeof t!="string")return"site"in t&&t.site?t?.site:void 0}function ds(t,e){for(let r in t)e.includes(r)?delete t[r]:typeof t[r]=="object"&&ds(t[r],e)}function bs(t){return t.map(({name:e,id:r})=>`${e} (${r})`).join(", ")}function lf(t){let e=process.version,{griddoVersion:r}=af,n=`
28
28
  \xB7\xB7
29
29
  \xB7\xB7 Griddo Exporter ${r}
30
30
  \xB7\xB7 Adapter: ${t}
@@ -109,12 +109,14 @@ export interface EndPageInfoResponse {
109
109
  /** Response message */
110
110
  message: string;
111
111
  }
112
+ /** Response type for the embedding answer in the ai search feature */
113
+ export type PostEmbeddingsResponse = string;
112
114
  /** Describes a response type for GET all sites */
113
115
  export type AllSitesReponse = Array<Site>;
114
116
  /** Describes a response type for GET one page */
115
117
  export type PageResponse = APIPageObject;
116
118
  /** All types for the API response used in the api functions get, put, post */
117
- export type APIResponses = Domains | Robots | Settings | AllSitesReponse | Site | LanguagesResponse | StartPageRenderResponse | SitemapAPIResponse | SocialsResponse | PageResponse | EndPageInfoResponse | DistributorResponse | PostSearchInfoResponse;
119
+ export type APIResponses = Domains | Robots | Settings | AllSitesReponse | Site | LanguagesResponse | StartPageRenderResponse | SitemapAPIResponse | SocialsResponse | PageResponse | EndPageInfoResponse | DistributorResponse | PostSearchInfoResponse | PostEmbeddingsResponse;
118
120
  export interface ShowApiErrorOptions {
119
121
  callInfo: {
120
122
  endpoint?: string;
@@ -18,7 +18,7 @@ GFS4: `),console.error(e)});U[Y]||(co=global[Y]||[],lo(U,co),U.close=function(e)
18
18
  `).join(`
19
19
  `+o),e.push(i+"m+"+Tr.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=sp()+t+" "+e[0]}function sp(){return X.inspectOpts.hideDate?"":new Date().toISOString()+" "}function ap(...e){return process.stderr.write(Mr.format(...e)+`
20
20
  `)}function cp(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function up(){return process.env.DEBUG}function lp(e){e.inspectOpts={};let t=Object.keys(X.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=X.inspectOpts[t[r]]}Tr.exports=Zn()(X);var{formatters:fu}=Tr.exports;fu.o=function(e){return this.inspectOpts.colors=this.useColors,Mr.inspect(e,this.inspectOpts).split(`
21
- `).map(t=>t.trim()).join(" ")};fu.O=function(e){return this.inspectOpts.colors=this.useColors,Mr.inspect(e,this.inspectOpts)}});var du=v((tg,ei)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ei.exports=lu():ei.exports=hu()});var mu=v((rg,pu)=>{var At;pu.exports=function(){if(!At){try{At=du()("follow-redirects")}catch{}typeof At!="function"&&(At=function(){})}At.apply(null,arguments)}});var si=v((ng,oi)=>{var $e=require("url"),ti=$e.URL,fp=require("http"),hp=require("https"),vu=require("stream").Writable,bu=require("assert"),wu=mu(),ni=["abort","aborted","connect","error","socket","timeout"],ii=Object.create(null);ni.forEach(function(e){ii[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var dp=Tt("ERR_INVALID_URL","Invalid URL",TypeError),gu=Tt("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),pp=Tt("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),mp=Tt("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),gp=Tt("ERR_STREAM_WRITE_AFTER_END","write after end");function de(e,t){vu.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(n){r._processResponse(n)},this._performRequest()}de.prototype=Object.create(vu.prototype);de.prototype.abort=function(){Eu(this._currentRequest),this.emit("abort")};de.prototype.write=function(e,t,r){if(this._ending)throw new gp;if(!He(e)&&!bp(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Mt(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new mp),this.abort())};de.prototype.end=function(e,t,r){if(Mt(e)?(r=e,e=t=null):Mt(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var n=this,i=this._currentRequest;this.write(e,t,function(){n._ended=!0,i.end(null,null,r)}),this._ending=!0}};de.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};de.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};de.prototype.setTimeout=function(e,t){var r=this;function n(s){s.setTimeout(e),s.removeListener("timeout",s.destroy),s.addListener("timeout",s.destroy)}function i(s){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),o()},e),n(s)}function o(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",o),r.removeListener("error",o),r.removeListener("response",o),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",o),this.on("error",o),this.on("response",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){de.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(de.prototype,e,{get:function(){return this._currentRequest[e]}})});de.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};de.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t){this.emit("error",new TypeError("Unsupported protocol "+e));return}if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of ni)n.on(i,ii[i]);if(this._currentUrl=/^\//.test(this._options.path)?$e.format(this._options):this._options.path,this._isRedirect){var o=0,s=this,a=this._requestBodyBuffers;(function c(d){if(n===s._currentRequest)if(d)s.emit("error",d);else if(o<a.length){var f=a[o++];n.finished||n.write(f.data,f.encoding,c)}else s._ended&&n.end()})()}};de.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(Eu(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects){this.emit("error",new pp);return}var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],ri(/^content-/i,this._options.headers));var s=ri(/^host$/i,this._options.headers),a=$e.parse(this._currentUrl),c=s||a.host,d=/^\w+:/.test(r)?this._currentUrl:$e.format(Object.assign(a,{host:c})),f;try{f=$e.resolve(d,r)}catch(S){this.emit("error",new gu({cause:S}));return}wu("redirecting to",f),this._isRedirect=!0;var p=$e.parse(f);if(Object.assign(this._options,p),(p.protocol!==a.protocol&&p.protocol!=="https:"||p.host!==c&&!vp(p.host,c))&&ri(/^(?:authorization|cookie)$/i,this._options.headers),Mt(i)){var g={headers:e.headers,statusCode:t},m={url:d,method:o,headers:n};try{i(this._options,g,m)}catch(S){this.emit("error",S);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(S){this.emit("error",new gu({cause:S}))}};function Su(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(n){var i=n+":",o=r[i]=e[n],s=t[n]=Object.create(o);function a(d,f,p){if(He(d)){var g;try{g=yu(new ti(d))}catch{g=$e.parse(d)}if(!He(g.protocol))throw new dp({input:d});d=g}else ti&&d instanceof ti?d=yu(d):(p=f,f=d,d={protocol:i});return Mt(f)&&(p=f,f=null),f=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},d,f),f.nativeProtocols=r,!He(f.host)&&!He(f.hostname)&&(f.hostname="::1"),bu.equal(f.protocol,i,"protocol mismatch"),wu("options",f),new de(f,p)}function c(d,f,p){var g=s.request(d,f,p);return g.end(),g}Object.defineProperties(s,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),t}function yp(){}function yu(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return e.port!==""&&(t.port=Number(e.port)),t}function ri(e,t){var r;for(var n in t)e.test(n)&&(r=t[n],delete t[n]);return r===null||typeof r>"u"?void 0:String(r).trim()}function Tt(e,t,r){function n(i){Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return n.prototype=new(r||Error),n.prototype.constructor=n,n.prototype.name="Error ["+e+"]",n}function Eu(e){for(var t of ni)e.removeListener(t,ii[t]);e.on("error",yp),e.abort()}function vp(e,t){bu(He(e)&&He(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function He(e){return typeof e=="string"||e instanceof String}function Mt(e){return typeof e=="function"}function bp(e){return typeof e=="object"&&"length"in e}oi.exports=Su({http:fp,https:hp});oi.exports.wrap=Su});var ai=v((ig,wp)=>{wp.exports={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]}});var Ru=v((og,Ou)=>{"use strict";var qt=se(),xu=Yn(),Sp=Xn(),Ep=xr(),xp=require("http"),_p=require("https"),Cp=si().http,kp=si().https,_u=require("url"),Op=require("zlib"),Rp=ai(),qr=kr(),ci=Cr(),Cu=/https:?/;function ku(e,t,r){if(e.hostname=t.host,e.host=t.host,e.port=t.port,e.path=r,t.auth){var n=Buffer.from(t.auth.username+":"+t.auth.password,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.beforeRedirect=function(o){o.headers.host=o.host,ku(o,t,o.href)}}Ou.exports=function(t){return new Promise(function(n,i){var o=function(_){n(_)},s=function(_){i(_)},a=t.data,c=t.headers;if("User-Agent"in c||"user-agent"in c?!c["User-Agent"]&&!c["user-agent"]&&(delete c["User-Agent"],delete c["user-agent"]):c["User-Agent"]="axios/"+Rp.version,a&&!qt.isStream(a)){if(!Buffer.isBuffer(a))if(qt.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else if(qt.isString(a))a=Buffer.from(a,"utf-8");else return s(qr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",t));c["Content-Length"]=a.length}var d=void 0;if(t.auth){var f=t.auth.username||"",p=t.auth.password||"";d=f+":"+p}var g=Sp(t.baseURL,t.url),m=_u.parse(g),S=m.protocol||"http:";if(!d&&m.auth){var O=m.auth.split(":"),R=O[0]||"",T=O[1]||"";d=R+":"+T}d&&delete c.Authorization;var $=Cu.test(S),z=$?t.httpsAgent:t.httpAgent,G={path:Ep(m.path,t.params,t.paramsSerializer).replace(/^\?/,""),method:t.method.toUpperCase(),headers:c,agent:z,agents:{http:t.httpAgent,https:t.httpsAgent},auth:d};t.socketPath?G.socketPath=t.socketPath:(G.hostname=m.hostname,G.port=m.port);var re=t.proxy;if(!re&&re!==!1){var ve=S.slice(0,-1)+"_proxy",ke=process.env[ve]||process.env[ve.toUpperCase()];if(ke){var ae=_u.parse(ke),k=process.env.no_proxy||process.env.NO_PROXY,F=!0;if(k){var q=k.split(",").map(function(_){return _.trim()});F=!q.some(function(_){return _?_==="*"||_[0]==="."&&m.hostname.substr(m.hostname.length-_.length)===_?!0:m.hostname===_:!1})}if(F&&(re={host:ae.hostname,port:ae.port,protocol:ae.protocol},ae.auth)){var H=ae.auth.split(":");re.auth={username:H[0],password:H[1]}}}}re&&(G.headers.host=m.hostname+(m.port?":"+m.port:""),ku(G,re,S+"//"+m.hostname+(m.port?":"+m.port:"")+G.path));var P,B=$&&(re?Cu.test(re.protocol):!0);t.transport?P=t.transport:t.maxRedirects===0?P=B?_p:xp:(t.maxRedirects&&(G.maxRedirects=t.maxRedirects),P=B?kp:Cp),t.maxBodyLength>-1&&(G.maxBodyLength=t.maxBodyLength);var C=P.request(G,function(_){if(!C.aborted){var A=_,Oe=_.req||C;if(_.statusCode!==204&&Oe.method!=="HEAD"&&t.decompress!==!1)switch(_.headers["content-encoding"]){case"gzip":case"compress":case"deflate":A=A.pipe(Op.createUnzip()),delete _.headers["content-encoding"];break}var Ie={status:_.statusCode,statusText:_.statusMessage,headers:_.headers,config:t,request:Oe};if(t.responseType==="stream")Ie.data=A,xu(o,s,Ie);else{var ce=[],pe=0;A.on("data",function(me){ce.push(me),pe+=me.length,t.maxContentLength>-1&&pe>t.maxContentLength&&(A.destroy(),s(qr("maxContentLength size of "+t.maxContentLength+" exceeded",t,null,Oe)))}),A.on("error",function(me){C.aborted||s(ci(me,t,null,Oe))}),A.on("end",function(){var me=Buffer.concat(ce);t.responseType!=="arraybuffer"&&(me=me.toString(t.responseEncoding),(!t.responseEncoding||t.responseEncoding==="utf8")&&(me=qt.stripBOM(me))),Ie.data=me,xu(o,s,Ie)})}}});if(C.on("error",function(_){C.aborted&&_.code!=="ERR_FR_TOO_MANY_REDIRECTS"||s(ci(_,t,null,C))}),t.timeout){var D=parseInt(t.timeout,10);if(isNaN(D)){s(qr("error trying to parse `config.timeout` to int",t,"ERR_PARSE_TIMEOUT",C));return}C.setTimeout(D,function(){C.abort(),s(qr("timeout of "+D+"ms exceeded",t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",C))})}t.cancelToken&&t.cancelToken.promise.then(function(_){C.aborted||(C.abort(),s(_))}),qt.isStream(a)?a.on("error",function(_){s(ci(_,t,null,C))}).pipe(C):C.end(a)})}});var Ir=v((sg,Mu)=>{"use strict";var K=se(),Pu=Uc(),Pp=Cr(),Ap={"Content-Type":"application/x-www-form-urlencoded"};function Au(e,t){!K.isUndefined(e)&&K.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function Mp(){var e;return typeof XMLHttpRequest<"u"?e=su():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(e=Ru()),e}function Tp(e,t,r){if(K.isString(e))try{return(t||JSON.parse)(e),K.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var Fr={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Mp(),transformRequest:[function(t,r){return Pu(r,"Accept"),Pu(r,"Content-Type"),K.isFormData(t)||K.isArrayBuffer(t)||K.isBuffer(t)||K.isStream(t)||K.isFile(t)||K.isBlob(t)?t:K.isArrayBufferView(t)?t.buffer:K.isURLSearchParams(t)?(Au(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):K.isObject(t)||r&&r["Content-Type"]==="application/json"?(Au(r,"application/json"),Tp(t)):t}],transformResponse:[function(t){var r=this.transitional,n=r&&r.silentJSONParsing,i=r&&r.forcedJSONParsing,o=!n&&this.responseType==="json";if(o||i&&K.isString(t)&&t.length)try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?Pp(s,this,"E_JSON_PARSE"):s}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};Fr.headers={common:{Accept:"application/json, text/plain, */*"}};K.forEach(["delete","get","head"],function(t){Fr.headers[t]={}});K.forEach(["post","put","patch"],function(t){Fr.headers[t]=K.merge(Ap)});Mu.exports=Fr});var qu=v((ag,Tu)=>{"use strict";var qp=se(),Fp=Ir();Tu.exports=function(t,r,n){var i=this||Fp;return qp.forEach(n,function(s){t=s.call(i,t,r)}),t}});var ui=v((cg,Fu)=>{"use strict";Fu.exports=function(t){return!!(t&&t.__CANCEL__)}});var Nu=v((ug,Du)=>{"use strict";var Iu=se(),li=qu(),Ip=ui(),Dp=Ir();function fi(e){e.cancelToken&&e.cancelToken.throwIfRequested()}Du.exports=function(t){fi(t),t.headers=t.headers||{},t.data=li.call(t,t.data,t.headers,t.transformRequest),t.headers=Iu.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Iu.forEach(["delete","get","head","post","put","patch","common"],function(i){delete t.headers[i]});var r=t.adapter||Dp.adapter;return r(t).then(function(i){return fi(t),i.data=li.call(t,i.data,i.headers,t.transformResponse),i},function(i){return Ip(i)||(fi(t),i&&i.response&&(i.response.data=li.call(t,i.response.data,i.response.headers,t.transformResponse))),Promise.reject(i)})}});var hi=v((lg,ju)=>{"use strict";var te=se();ju.exports=function(t,r){r=r||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(g,m){return te.isPlainObject(g)&&te.isPlainObject(m)?te.merge(g,m):te.isPlainObject(m)?te.merge({},m):te.isArray(m)?m.slice():m}function d(g){te.isUndefined(r[g])?te.isUndefined(t[g])||(n[g]=c(void 0,t[g])):n[g]=c(t[g],r[g])}te.forEach(i,function(m){te.isUndefined(r[m])||(n[m]=c(void 0,r[m]))}),te.forEach(o,d),te.forEach(s,function(m){te.isUndefined(r[m])?te.isUndefined(t[m])||(n[m]=c(void 0,t[m])):n[m]=c(void 0,r[m])}),te.forEach(a,function(m){m in r?n[m]=c(t[m],r[m]):m in t&&(n[m]=c(void 0,t[m]))});var f=i.concat(o).concat(s).concat(a),p=Object.keys(t).concat(Object.keys(r)).filter(function(m){return f.indexOf(m)===-1});return te.forEach(p,d),n}});var Uu=v((fg,Hu)=>{"use strict";var Bu=ai(),di={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){di[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var Lu={},Np=Bu.version.split(".");function $u(e,t){for(var r=t?t.split("."):Np,n=e.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}di.transitional=function(t,r,n){var i=r&&$u(r);function o(s,a){return"[Axios v"+Bu.version+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return function(s,a,c){if(t===!1)throw new Error(o(a," has been removed in "+r));return i&&!Lu[a]&&(Lu[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,a,c):!0}};function jp(e,t,r){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],s=t[o];if(s){var a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new TypeError("option "+o+" must be "+c);continue}if(r!==!0)throw Error("Unknown option "+o)}}Hu.exports={isOlderVersion:$u,assertOptions:jp,validators:di}});var Yu=v((hg,Vu)=>{"use strict";var Ju=se(),Lp=xr(),Gu=$c(),zu=Nu(),Dr=hi(),Wu=Uu(),lt=Wu.validators;function Ft(e){this.defaults=e,this.interceptors={request:new Gu,response:new Gu}}Ft.prototype.request=function(t){typeof t=="string"?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=Dr(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;r!==void 0&&Wu.assertOptions(r,{silentJSONParsing:lt.transitional(lt.boolean,"1.0.0"),forcedJSONParsing:lt.transitional(lt.boolean,"1.0.0"),clarifyTimeoutError:lt.transitional(lt.boolean,"1.0.0")},!1);var n=[],i=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(i=i&&g.synchronous,n.unshift(g.fulfilled,g.rejected))});var o=[];this.interceptors.response.forEach(function(g){o.push(g.fulfilled,g.rejected)});var s;if(!i){var a=[zu,void 0];for(Array.prototype.unshift.apply(a,n),a=a.concat(o),s=Promise.resolve(t);a.length;)s=s.then(a.shift(),a.shift());return s}for(var c=t;n.length;){var d=n.shift(),f=n.shift();try{c=d(c)}catch(p){f(p);break}}try{s=zu(c)}catch(p){return Promise.reject(p)}for(;o.length;)s=s.then(o.shift(),o.shift());return s};Ft.prototype.getUri=function(t){return t=Dr(this.defaults,t),Lp(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};Ju.forEach(["delete","get","head","options"],function(t){Ft.prototype[t]=function(r,n){return this.request(Dr(n||{},{method:t,url:r,data:(n||{}).data}))}});Ju.forEach(["post","put","patch"],function(t){Ft.prototype[t]=function(r,n,i){return this.request(Dr(i||{},{method:t,url:r,data:n}))}});Vu.exports=Ft});var mi=v((dg,Xu)=>{"use strict";function pi(e){this.message=e}pi.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};pi.prototype.__CANCEL__=!0;Xu.exports=pi});var Qu=v((pg,Ku)=>{"use strict";var Bp=mi();function Nr(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(i){t=i});var r=this;e(function(i){r.reason||(r.reason=new Bp(i),t(r.reason))})}Nr.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Nr.source=function(){var t,r=new Nr(function(i){t=i});return{token:r,cancel:t}};Ku.exports=Nr});var el=v((mg,Zu)=>{"use strict";Zu.exports=function(t){return function(n){return t.apply(null,n)}}});var rl=v((gg,tl)=>{"use strict";tl.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}});var ol=v((yg,gi)=>{"use strict";var nl=se(),$p=Gn(),jr=Yu(),Hp=hi(),Up=Ir();function il(e){var t=new jr(e),r=$p(jr.prototype.request,t);return nl.extend(r,jr.prototype,t),nl.extend(r,t),r}var xe=il(Up);xe.Axios=jr;xe.create=function(t){return il(Hp(xe.defaults,t))};xe.Cancel=mi();xe.CancelToken=Qu();xe.isCancel=ui();xe.all=function(t){return Promise.all(t)};xe.spread=el();xe.isAxiosError=rl();gi.exports=xe;gi.exports.default=xe});var yi=v((vg,sl)=>{sl.exports=ol()});var xl=N(require("node:fs")),_l=N(Nt());var Pc=N(require("node:fs"));var Bn=N(Gt()),Ac=N(Nt()),hd=N(_t()),dd=N(Za()),Mc=N(vr());var rd=N(_t());var vc=N(require("node:fs")),br=N(require("node:path")),bc=N(_t());var wc=Ee();function Sc(e){let{__caches:t}=wc.paths(e);return td({basePath:br.default.join(t,"store"),withSizeProp:!1})}function*td(e){let{basePath:t,withSizeProp:r}=e||{},{__cx:n}=wc.paths(),i=t||br.default.join(n,"store"),o=Ec(i).filter(s=>br.default.extname(s)===".json");for(let s of o)try{let a=bc.default.readJsonSync(s,{encoding:"utf-8"});if(r){let c=vc.default.statSync(s);a.size=c.size/1024}a.path&&(yield a)}catch(a){console.error(`Error: The file ${s} doesn't exist`,a)}}var k1=Ee();Ac.default.config();var F1=Ee(),pd=Pt(process.env.GRIDDO_DEBUG_LOGS),md=Pt(process.env.GRIDDO_BUILD_LOGS),I1=Mc.default.sync(),D1={clean:JSON.parse(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS||"1"),prepare:JSON.parse(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS||"1"),restore:JSON.parse(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS||"1"),data:JSON.parse(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS||"1"),ssg:JSON.parse(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS||"2"),relocation:JSON.parse(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS||"1"),meta:JSON.parse(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS||"4"),archive:JSON.parse(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS||"1")};function Ee(){try{return(Rc(),Ml(Oc)).default}catch{console.log("Error while reading configuration file"),process.exit(1)}}function Tc(e){pd&&console.log(Bn.default.hex("#ffff33")("verbose"),Bn.default.gray(e.replace(/(\s)\s+/g,"$1").trim()))}function Pt(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(e.toLowerCase()==="true")return!0;if(e.toLowerCase()==="false")return!1;if(e.toLowerCase()==="on")return!0;if(e.toLowerCase()==="off")return!1;let t=parseInt(e,10);return isNaN(t)?!1:t>0}function Ec(e){let t=[];return Pc.default.readdirSync(e).forEach(n=>{let i=`${e}/${n}`;t.push(i)}),t}function $n(e){md&&console.info(e.replace(/(\s)\s+/g,"$1").trim())}function qc(e){return new Promise(t=>setTimeout(t,e))}function Hn(e,t=3){return(e/1e3).toFixed(t)}function Un(e){return"site"in e&&e.site?e?.site:void 0}var al=N(yi()),cl=N(Gt()),vi=class{user;password;baseUrl;headers;constructor(){this.user=process.env.botEmail,this.password=process.env.botPassword,this.baseUrl=process.env.API_URL}async login(){try{let t=await(0,al.default)({url:`${this.baseUrl}/login_check`,method:"POST",headers:{"Content-Type":"application/json"},data:{username:this.user,password:this.password}});if(t.status===200){let{data:{token:r}}=t;this.headers={Authorization:"bearer "+r,"Cache-Control":"no-store"}}return this.headers}catch{console.error(cl.default.red(`
21
+ `).map(t=>t.trim()).join(" ")};fu.O=function(e){return this.inspectOpts.colors=this.useColors,Mr.inspect(e,this.inspectOpts)}});var du=v((tg,ei)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ei.exports=lu():ei.exports=hu()});var mu=v((rg,pu)=>{var At;pu.exports=function(){if(!At){try{At=du()("follow-redirects")}catch{}typeof At!="function"&&(At=function(){})}At.apply(null,arguments)}});var si=v((ng,oi)=>{var $e=require("url"),ti=$e.URL,fp=require("http"),hp=require("https"),vu=require("stream").Writable,bu=require("assert"),wu=mu(),ni=["abort","aborted","connect","error","socket","timeout"],ii=Object.create(null);ni.forEach(function(e){ii[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var dp=Tt("ERR_INVALID_URL","Invalid URL",TypeError),gu=Tt("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),pp=Tt("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),mp=Tt("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),gp=Tt("ERR_STREAM_WRITE_AFTER_END","write after end");function de(e,t){vu.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(n){r._processResponse(n)},this._performRequest()}de.prototype=Object.create(vu.prototype);de.prototype.abort=function(){Eu(this._currentRequest),this.emit("abort")};de.prototype.write=function(e,t,r){if(this._ending)throw new gp;if(!He(e)&&!bp(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Mt(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new mp),this.abort())};de.prototype.end=function(e,t,r){if(Mt(e)?(r=e,e=t=null):Mt(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var n=this,i=this._currentRequest;this.write(e,t,function(){n._ended=!0,i.end(null,null,r)}),this._ending=!0}};de.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};de.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};de.prototype.setTimeout=function(e,t){var r=this;function n(s){s.setTimeout(e),s.removeListener("timeout",s.destroy),s.addListener("timeout",s.destroy)}function i(s){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),o()},e),n(s)}function o(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",o),r.removeListener("error",o),r.removeListener("response",o),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",o),this.on("error",o),this.on("response",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){de.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(de.prototype,e,{get:function(){return this._currentRequest[e]}})});de.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};de.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t){this.emit("error",new TypeError("Unsupported protocol "+e));return}if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of ni)n.on(i,ii[i]);if(this._currentUrl=/^\//.test(this._options.path)?$e.format(this._options):this._options.path,this._isRedirect){var o=0,s=this,a=this._requestBodyBuffers;(function c(d){if(n===s._currentRequest)if(d)s.emit("error",d);else if(o<a.length){var f=a[o++];n.finished||n.write(f.data,f.encoding,c)}else s._ended&&n.end()})()}};de.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(Eu(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects){this.emit("error",new pp);return}var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],ri(/^content-/i,this._options.headers));var s=ri(/^host$/i,this._options.headers),a=$e.parse(this._currentUrl),c=s||a.host,d=/^\w+:/.test(r)?this._currentUrl:$e.format(Object.assign(a,{host:c})),f;try{f=$e.resolve(d,r)}catch(S){this.emit("error",new gu({cause:S}));return}wu("redirecting to",f),this._isRedirect=!0;var p=$e.parse(f);if(Object.assign(this._options,p),(p.protocol!==a.protocol&&p.protocol!=="https:"||p.host!==c&&!vp(p.host,c))&&ri(/^(?:authorization|cookie)$/i,this._options.headers),Mt(i)){var g={headers:e.headers,statusCode:t},m={url:d,method:o,headers:n};try{i(this._options,g,m)}catch(S){this.emit("error",S);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(S){this.emit("error",new gu({cause:S}))}};function Su(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(n){var i=n+":",o=r[i]=e[n],s=t[n]=Object.create(o);function a(d,f,p){if(He(d)){var g;try{g=yu(new ti(d))}catch{g=$e.parse(d)}if(!He(g.protocol))throw new dp({input:d});d=g}else ti&&d instanceof ti?d=yu(d):(p=f,f=d,d={protocol:i});return Mt(f)&&(p=f,f=null),f=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},d,f),f.nativeProtocols=r,!He(f.host)&&!He(f.hostname)&&(f.hostname="::1"),bu.equal(f.protocol,i,"protocol mismatch"),wu("options",f),new de(f,p)}function c(d,f,p){var g=s.request(d,f,p);return g.end(),g}Object.defineProperties(s,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),t}function yp(){}function yu(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return e.port!==""&&(t.port=Number(e.port)),t}function ri(e,t){var r;for(var n in t)e.test(n)&&(r=t[n],delete t[n]);return r===null||typeof r>"u"?void 0:String(r).trim()}function Tt(e,t,r){function n(i){Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return n.prototype=new(r||Error),n.prototype.constructor=n,n.prototype.name="Error ["+e+"]",n}function Eu(e){for(var t of ni)e.removeListener(t,ii[t]);e.on("error",yp),e.abort()}function vp(e,t){bu(He(e)&&He(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function He(e){return typeof e=="string"||e instanceof String}function Mt(e){return typeof e=="function"}function bp(e){return typeof e=="object"&&"length"in e}oi.exports=Su({http:fp,https:hp});oi.exports.wrap=Su});var ai=v((ig,wp)=>{wp.exports={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]}});var Ru=v((og,Ou)=>{"use strict";var qt=se(),xu=Yn(),Sp=Xn(),Ep=xr(),xp=require("http"),_p=require("https"),Cp=si().http,kp=si().https,_u=require("url"),Op=require("zlib"),Rp=ai(),qr=kr(),ci=Cr(),Cu=/https:?/;function ku(e,t,r){if(e.hostname=t.host,e.host=t.host,e.port=t.port,e.path=r,t.auth){var n=Buffer.from(t.auth.username+":"+t.auth.password,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.beforeRedirect=function(o){o.headers.host=o.host,ku(o,t,o.href)}}Ou.exports=function(t){return new Promise(function(n,i){var o=function(_){n(_)},s=function(_){i(_)},a=t.data,c=t.headers;if("User-Agent"in c||"user-agent"in c?!c["User-Agent"]&&!c["user-agent"]&&(delete c["User-Agent"],delete c["user-agent"]):c["User-Agent"]="axios/"+Rp.version,a&&!qt.isStream(a)){if(!Buffer.isBuffer(a))if(qt.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else if(qt.isString(a))a=Buffer.from(a,"utf-8");else return s(qr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",t));c["Content-Length"]=a.length}var d=void 0;if(t.auth){var f=t.auth.username||"",p=t.auth.password||"";d=f+":"+p}var g=Sp(t.baseURL,t.url),m=_u.parse(g),S=m.protocol||"http:";if(!d&&m.auth){var O=m.auth.split(":"),R=O[0]||"",T=O[1]||"";d=R+":"+T}d&&delete c.Authorization;var $=Cu.test(S),z=$?t.httpsAgent:t.httpAgent,G={path:Ep(m.path,t.params,t.paramsSerializer).replace(/^\?/,""),method:t.method.toUpperCase(),headers:c,agent:z,agents:{http:t.httpAgent,https:t.httpsAgent},auth:d};t.socketPath?G.socketPath=t.socketPath:(G.hostname=m.hostname,G.port=m.port);var re=t.proxy;if(!re&&re!==!1){var ve=S.slice(0,-1)+"_proxy",ke=process.env[ve]||process.env[ve.toUpperCase()];if(ke){var ae=_u.parse(ke),k=process.env.no_proxy||process.env.NO_PROXY,F=!0;if(k){var q=k.split(",").map(function(_){return _.trim()});F=!q.some(function(_){return _?_==="*"||_[0]==="."&&m.hostname.substr(m.hostname.length-_.length)===_?!0:m.hostname===_:!1})}if(F&&(re={host:ae.hostname,port:ae.port,protocol:ae.protocol},ae.auth)){var H=ae.auth.split(":");re.auth={username:H[0],password:H[1]}}}}re&&(G.headers.host=m.hostname+(m.port?":"+m.port:""),ku(G,re,S+"//"+m.hostname+(m.port?":"+m.port:"")+G.path));var P,B=$&&(re?Cu.test(re.protocol):!0);t.transport?P=t.transport:t.maxRedirects===0?P=B?_p:xp:(t.maxRedirects&&(G.maxRedirects=t.maxRedirects),P=B?kp:Cp),t.maxBodyLength>-1&&(G.maxBodyLength=t.maxBodyLength);var C=P.request(G,function(_){if(!C.aborted){var A=_,Oe=_.req||C;if(_.statusCode!==204&&Oe.method!=="HEAD"&&t.decompress!==!1)switch(_.headers["content-encoding"]){case"gzip":case"compress":case"deflate":A=A.pipe(Op.createUnzip()),delete _.headers["content-encoding"];break}var Ie={status:_.statusCode,statusText:_.statusMessage,headers:_.headers,config:t,request:Oe};if(t.responseType==="stream")Ie.data=A,xu(o,s,Ie);else{var ce=[],pe=0;A.on("data",function(me){ce.push(me),pe+=me.length,t.maxContentLength>-1&&pe>t.maxContentLength&&(A.destroy(),s(qr("maxContentLength size of "+t.maxContentLength+" exceeded",t,null,Oe)))}),A.on("error",function(me){C.aborted||s(ci(me,t,null,Oe))}),A.on("end",function(){var me=Buffer.concat(ce);t.responseType!=="arraybuffer"&&(me=me.toString(t.responseEncoding),(!t.responseEncoding||t.responseEncoding==="utf8")&&(me=qt.stripBOM(me))),Ie.data=me,xu(o,s,Ie)})}}});if(C.on("error",function(_){C.aborted&&_.code!=="ERR_FR_TOO_MANY_REDIRECTS"||s(ci(_,t,null,C))}),t.timeout){var D=parseInt(t.timeout,10);if(isNaN(D)){s(qr("error trying to parse `config.timeout` to int",t,"ERR_PARSE_TIMEOUT",C));return}C.setTimeout(D,function(){C.abort(),s(qr("timeout of "+D+"ms exceeded",t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",C))})}t.cancelToken&&t.cancelToken.promise.then(function(_){C.aborted||(C.abort(),s(_))}),qt.isStream(a)?a.on("error",function(_){s(ci(_,t,null,C))}).pipe(C):C.end(a)})}});var Ir=v((sg,Mu)=>{"use strict";var K=se(),Pu=Uc(),Pp=Cr(),Ap={"Content-Type":"application/x-www-form-urlencoded"};function Au(e,t){!K.isUndefined(e)&&K.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function Mp(){var e;return typeof XMLHttpRequest<"u"?e=su():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(e=Ru()),e}function Tp(e,t,r){if(K.isString(e))try{return(t||JSON.parse)(e),K.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var Fr={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Mp(),transformRequest:[function(t,r){return Pu(r,"Accept"),Pu(r,"Content-Type"),K.isFormData(t)||K.isArrayBuffer(t)||K.isBuffer(t)||K.isStream(t)||K.isFile(t)||K.isBlob(t)?t:K.isArrayBufferView(t)?t.buffer:K.isURLSearchParams(t)?(Au(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):K.isObject(t)||r&&r["Content-Type"]==="application/json"?(Au(r,"application/json"),Tp(t)):t}],transformResponse:[function(t){var r=this.transitional,n=r&&r.silentJSONParsing,i=r&&r.forcedJSONParsing,o=!n&&this.responseType==="json";if(o||i&&K.isString(t)&&t.length)try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?Pp(s,this,"E_JSON_PARSE"):s}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};Fr.headers={common:{Accept:"application/json, text/plain, */*"}};K.forEach(["delete","get","head"],function(t){Fr.headers[t]={}});K.forEach(["post","put","patch"],function(t){Fr.headers[t]=K.merge(Ap)});Mu.exports=Fr});var qu=v((ag,Tu)=>{"use strict";var qp=se(),Fp=Ir();Tu.exports=function(t,r,n){var i=this||Fp;return qp.forEach(n,function(s){t=s.call(i,t,r)}),t}});var ui=v((cg,Fu)=>{"use strict";Fu.exports=function(t){return!!(t&&t.__CANCEL__)}});var Nu=v((ug,Du)=>{"use strict";var Iu=se(),li=qu(),Ip=ui(),Dp=Ir();function fi(e){e.cancelToken&&e.cancelToken.throwIfRequested()}Du.exports=function(t){fi(t),t.headers=t.headers||{},t.data=li.call(t,t.data,t.headers,t.transformRequest),t.headers=Iu.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Iu.forEach(["delete","get","head","post","put","patch","common"],function(i){delete t.headers[i]});var r=t.adapter||Dp.adapter;return r(t).then(function(i){return fi(t),i.data=li.call(t,i.data,i.headers,t.transformResponse),i},function(i){return Ip(i)||(fi(t),i&&i.response&&(i.response.data=li.call(t,i.response.data,i.response.headers,t.transformResponse))),Promise.reject(i)})}});var hi=v((lg,ju)=>{"use strict";var te=se();ju.exports=function(t,r){r=r||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(g,m){return te.isPlainObject(g)&&te.isPlainObject(m)?te.merge(g,m):te.isPlainObject(m)?te.merge({},m):te.isArray(m)?m.slice():m}function d(g){te.isUndefined(r[g])?te.isUndefined(t[g])||(n[g]=c(void 0,t[g])):n[g]=c(t[g],r[g])}te.forEach(i,function(m){te.isUndefined(r[m])||(n[m]=c(void 0,r[m]))}),te.forEach(o,d),te.forEach(s,function(m){te.isUndefined(r[m])?te.isUndefined(t[m])||(n[m]=c(void 0,t[m])):n[m]=c(void 0,r[m])}),te.forEach(a,function(m){m in r?n[m]=c(t[m],r[m]):m in t&&(n[m]=c(void 0,t[m]))});var f=i.concat(o).concat(s).concat(a),p=Object.keys(t).concat(Object.keys(r)).filter(function(m){return f.indexOf(m)===-1});return te.forEach(p,d),n}});var Uu=v((fg,Hu)=>{"use strict";var Bu=ai(),di={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){di[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var Lu={},Np=Bu.version.split(".");function $u(e,t){for(var r=t?t.split("."):Np,n=e.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}di.transitional=function(t,r,n){var i=r&&$u(r);function o(s,a){return"[Axios v"+Bu.version+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return function(s,a,c){if(t===!1)throw new Error(o(a," has been removed in "+r));return i&&!Lu[a]&&(Lu[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,a,c):!0}};function jp(e,t,r){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],s=t[o];if(s){var a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new TypeError("option "+o+" must be "+c);continue}if(r!==!0)throw Error("Unknown option "+o)}}Hu.exports={isOlderVersion:$u,assertOptions:jp,validators:di}});var Yu=v((hg,Vu)=>{"use strict";var Ju=se(),Lp=xr(),Gu=$c(),zu=Nu(),Dr=hi(),Wu=Uu(),lt=Wu.validators;function Ft(e){this.defaults=e,this.interceptors={request:new Gu,response:new Gu}}Ft.prototype.request=function(t){typeof t=="string"?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=Dr(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;r!==void 0&&Wu.assertOptions(r,{silentJSONParsing:lt.transitional(lt.boolean,"1.0.0"),forcedJSONParsing:lt.transitional(lt.boolean,"1.0.0"),clarifyTimeoutError:lt.transitional(lt.boolean,"1.0.0")},!1);var n=[],i=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(i=i&&g.synchronous,n.unshift(g.fulfilled,g.rejected))});var o=[];this.interceptors.response.forEach(function(g){o.push(g.fulfilled,g.rejected)});var s;if(!i){var a=[zu,void 0];for(Array.prototype.unshift.apply(a,n),a=a.concat(o),s=Promise.resolve(t);a.length;)s=s.then(a.shift(),a.shift());return s}for(var c=t;n.length;){var d=n.shift(),f=n.shift();try{c=d(c)}catch(p){f(p);break}}try{s=zu(c)}catch(p){return Promise.reject(p)}for(;o.length;)s=s.then(o.shift(),o.shift());return s};Ft.prototype.getUri=function(t){return t=Dr(this.defaults,t),Lp(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};Ju.forEach(["delete","get","head","options"],function(t){Ft.prototype[t]=function(r,n){return this.request(Dr(n||{},{method:t,url:r,data:(n||{}).data}))}});Ju.forEach(["post","put","patch"],function(t){Ft.prototype[t]=function(r,n,i){return this.request(Dr(i||{},{method:t,url:r,data:n}))}});Vu.exports=Ft});var mi=v((dg,Xu)=>{"use strict";function pi(e){this.message=e}pi.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};pi.prototype.__CANCEL__=!0;Xu.exports=pi});var Qu=v((pg,Ku)=>{"use strict";var Bp=mi();function Nr(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(i){t=i});var r=this;e(function(i){r.reason||(r.reason=new Bp(i),t(r.reason))})}Nr.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Nr.source=function(){var t,r=new Nr(function(i){t=i});return{token:r,cancel:t}};Ku.exports=Nr});var el=v((mg,Zu)=>{"use strict";Zu.exports=function(t){return function(n){return t.apply(null,n)}}});var rl=v((gg,tl)=>{"use strict";tl.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}});var ol=v((yg,gi)=>{"use strict";var nl=se(),$p=Gn(),jr=Yu(),Hp=hi(),Up=Ir();function il(e){var t=new jr(e),r=$p(jr.prototype.request,t);return nl.extend(r,jr.prototype,t),nl.extend(r,t),r}var xe=il(Up);xe.Axios=jr;xe.create=function(t){return il(Hp(xe.defaults,t))};xe.Cancel=mi();xe.CancelToken=Qu();xe.isCancel=ui();xe.all=function(t){return Promise.all(t)};xe.spread=el();xe.isAxiosError=rl();gi.exports=xe;gi.exports.default=xe});var yi=v((vg,sl)=>{sl.exports=ol()});var xl=N(require("node:fs")),_l=N(Nt());var Pc=N(require("node:fs"));var Bn=N(Gt()),Ac=N(Nt()),hd=N(_t()),dd=N(Za()),Mc=N(vr());var rd=N(_t());var vc=N(require("node:fs")),br=N(require("node:path")),bc=N(_t());var wc=Ee();function Sc(e){let{__caches:t}=wc.paths(e);return td({basePath:br.default.join(t,"store"),withSizeProp:!1})}function*td(e){let{basePath:t,withSizeProp:r}=e||{},{__cx:n}=wc.paths(),i=t||br.default.join(n,"store"),o=Ec(i).filter(s=>br.default.extname(s)===".json");for(let s of o)try{let a=bc.default.readJsonSync(s,{encoding:"utf-8"});if(r){let c=vc.default.statSync(s);a.size=c.size/1024}a.path&&(yield a)}catch(a){console.error(`Error: The file ${s} doesn't exist`,a)}}var k1=Ee();Ac.default.config();var F1=Ee(),pd=Pt(process.env.GRIDDO_DEBUG_LOGS),md=Pt(process.env.GRIDDO_BUILD_LOGS),I1=Mc.default.sync(),D1={clean:JSON.parse(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS||"1"),prepare:JSON.parse(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS||"1"),restore:JSON.parse(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS||"1"),data:JSON.parse(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS||"1"),ssg:JSON.parse(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS||"2"),relocation:JSON.parse(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS||"1"),meta:JSON.parse(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS||"4"),archive:JSON.parse(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS||"1")};function Ee(){try{return(Rc(),Ml(Oc)).default}catch{console.log("Error while reading configuration file"),process.exit(1)}}function Tc(e){pd&&console.log(Bn.default.hex("#ffff33")("verbose"),Bn.default.gray(e.replace(/(\s)\s+/g,"$1").trim()))}function Pt(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(e.toLowerCase()==="true")return!0;if(e.toLowerCase()==="false")return!1;if(e.toLowerCase()==="on")return!0;if(e.toLowerCase()==="off")return!1;let t=parseInt(e,10);return isNaN(t)?!1:t>0}function Ec(e){let t=[];return Pc.default.readdirSync(e).forEach(n=>{let i=`${e}/${n}`;t.push(i)}),t}function $n(e){md&&console.info(e.replace(/(\s)\s+/g,"$1").trim())}function qc(e){return new Promise(t=>setTimeout(t,e))}function Hn(e,t=3){return(e/1e3).toFixed(t)}function Un(e){if(typeof e!="string")return"site"in e&&e.site?e?.site:void 0}var al=N(yi()),cl=N(Gt()),vi=class{user;password;baseUrl;headers;constructor(){this.user=process.env.botEmail,this.password=process.env.botPassword,this.baseUrl=process.env.API_URL}async login(){try{let t=await(0,al.default)({url:`${this.baseUrl}/login_check`,method:"POST",headers:{"Content-Type":"application/json"},data:{username:this.user,password:this.password}});if(t.status===200){let{data:{token:r}}=t;this.headers={Authorization:"bearer "+r,"Cache-Control":"no-store"}}return this.headers}catch{console.error(cl.default.red(`
22
22
  \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E
23
23
  \u2502 Access credentials failure \u2502
24
24
  \u2502 Check that the login details are correct in your .env file \u2502
@@ -47,4 +47,4 @@ ${p}
47
47
  ${g}
48
48
 
49
49
  =============
50
- `))}var Wp=process.env.API_URL,Vp={GET_ALL:`${Wp}/domains`},$r=class{static async getAll(){let{GET_ALL:t}=Vp;return await vl({endpoint:t})}};async function bl(){await Lr.login();let e=await $r.getAll();return Tc(`Getting domains slugs (${e.length})`),Yp(e)}function Yp(e){let t=e.filter(({slug:r})=>!!r).map(({slug:r})=>r.replace("/",""));return[...new Set(t)]}var Ei=N(require("node:fs")),xi=N(require("node:path"));var wl=process.env.API_URL;async function Xp(e){let{title:t,description:r,image:n,pageId:i,languageId:o,siteId:s,url:a,content:c,template:d}=e;return await Si({endpoint:`${wl}/search`,body:{title:t,description:r,image:n,pageId:i,languageId:o,siteId:s,url:a,template:d,content:Kp(c)}})}function Kp(e){let t=Qp(["meta","link","style","script","noscript","nav","header","footer"],e),r=Zp(t);return em(r)}function Qp(e,t){let r=t;return e.forEach(n=>{r=r.replace(new RegExp(`<${n}.*?>.*?</${n}>`,"gis")," ").replace(new RegExp(`(<${n}([^>]+)>)`,"gis")," ")}),r}function Zp(e){return e.replace(/(<([^>]+)>)/gis," ")}function em(e){return e.replace(/\s+/g," ")}async function Sl(e,t){let r=Ee(),{__caches:n}=r.paths(t),i=xi.default.join(n,"store");if(!Ei.default.existsSync(i)){console.log(`Skipping uploading content to the search endpoint for the domain ${t}, it has not exported sites.`);return}let o=Sc(t);for await(let s of o){let{context:{page:a,openGraph:c}}=s,{compose:d}=a.fullPath,f=xi.default.resolve(`${e}/${d}/index.html`),p=Ei.default.readFileSync(f).toString(),g={siteId:a.site,pageId:a.id,title:a.title,languageId:a.language,url:a.fullUrl,template:a.template.templateType||a.templateId,description:c.description,image:c.image,content:p};await Xp(g)}}async function El(){try{await Si({endpoint:`${wl}/ai/embeddings`})}catch(e){console.warn("There was an error with the ai embeddings",e.message)}}_l.default.config();var tm=Pt(process.env.GRIDDO_SEARCH_FEATURE),rm=Pt(process.env.GRIDDO_AI_EMBEDDINGS);async function nm(){if(!tm)return;let e=await bl(),t=Ee();for(let r of e){let{__exports_dist:n}=t.paths();xl.default.existsSync(n)&&await Sl(n,r)}rm&&await El()}nm().catch(e=>{console.error("Error",e?.stdout?.toString()||e),process.exit(1)});
50
+ `))}var Wp=process.env.API_URL,Vp={GET_ALL:`${Wp}/domains`},$r=class{static async getAll(){let{GET_ALL:t}=Vp;return await vl({endpoint:t})}};async function bl(){await Lr.login();let e=await $r.getAll();return Tc(`Getting domains slugs (${e.length})`),Yp(e)}function Yp(e){let t=e.filter(({slug:r})=>!!r).map(({slug:r})=>r.replace("/",""));return[...new Set(t)]}var Ei=N(require("node:fs")),xi=N(require("node:path"));var wl=process.env.API_URL;async function Xp(e){let{title:t,description:r,image:n,pageId:i,languageId:o,siteId:s,url:a,content:c,template:d}=e;return await Si({endpoint:`${wl}/search`,body:{title:t,description:r,image:n,pageId:i,languageId:o,siteId:s,url:a,template:d,content:Kp(c)}})}function Kp(e){let t=Qp(["meta","link","style","script","noscript","nav","header","footer"],e),r=Zp(t);return em(r)}function Qp(e,t){let r=t;return e.forEach(n=>{r=r.replace(new RegExp(`<${n}.*?>.*?</${n}>`,"gis")," ").replace(new RegExp(`(<${n}([^>]+)>)`,"gis")," ")}),r}function Zp(e){return e.replace(/(<([^>]+)>)/gis," ")}function em(e){return e.replace(/\s+/g," ")}async function Sl(e,t){let r=Ee(),{__caches:n}=r.paths(t),i=xi.default.join(n,"store");if(!Ei.default.existsSync(i)){console.log(`Skipping uploading content to the search endpoint for the domain ${t}, it has not exported sites.`);return}let o=Sc(t);for await(let s of o){let{context:{page:a,openGraph:c}}=s,{compose:d}=a.fullPath,f=xi.default.resolve(`${e}/${d}/index.html`),p=Ei.default.readFileSync(f).toString(),g={siteId:a.site,pageId:a.id,title:a.title,languageId:a.language,url:a.fullUrl,template:a.template.templateType||a.templateId,description:c.description,image:c.image,content:p};await Xp(g)}}async function El(){try{await Si({endpoint:`${wl}/ai/embeddings`})}catch(e){console.warn("There was an error with the ai embeddings",e.message)}}_l.default.config();var tm=Pt(process.env.GRIDDO_SEARCH_FEATURE),rm=Pt(process.env.GRIDDO_AI_EMBEDDINGS);async function nm(){if(!tm)return;let e=await bl(),t=Ee();for(let r of e){let{__exports_dist:n}=t.paths(r);xl.default.existsSync(n)&&await Sl(n,r)}rm&&await El()}nm().catch(e=>{console.error("Error",e?.stdout?.toString()||e),process.exit(1)});
@@ -148,6 +148,8 @@ export interface EndPageInfoResponse {
148
148
  /** Response message */
149
149
  message: string;
150
150
  }
151
+ /** Response type for the embedding answer in the ai search feature */
152
+ export type PostEmbeddingsResponse = string
151
153
 
152
154
  /** Describes a response type for GET all sites */
153
155
  export type AllSitesReponse = Array<Site>;
@@ -169,7 +171,8 @@ export type APIResponses =
169
171
  | PageResponse
170
172
  | EndPageInfoResponse
171
173
  | DistributorResponse
172
- | PostSearchInfoResponse;
174
+ | PostSearchInfoResponse
175
+ | PostEmbeddingsResponse;
173
176
 
174
177
  // TODO: JSDoc
175
178
  export interface ShowApiErrorOptions {
@@ -23,7 +23,7 @@ async function main() {
23
23
  const config = getConfig();
24
24
 
25
25
  for (const domain of domains) {
26
- const { __exports_dist } = config.paths();
26
+ const { __exports_dist } = config.paths(domain);
27
27
 
28
28
  // If __exports_dist has not exported sites (directories), it does not
29
29
  // upload search content.
@@ -258,6 +258,10 @@ export function msToSec(ms: number, decimals = 3) {
258
258
  * @param response A response object
259
259
  */
260
260
  export function getSafeSiteId(response: APIResponses) {
261
+ if (typeof response === "string") {
262
+ return undefined
263
+ }
264
+
261
265
  return "site" in response && response.site ? response?.site : undefined;
262
266
  }
263
267
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/cx",
3
3
  "description": "Griddo SSG based on Gatsby",
4
- "version": "10.6.1",
4
+ "version": "10.6.3",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -48,7 +48,7 @@
48
48
  "@babel/preset-env": "^7.14.5",
49
49
  "@babel/preset-react": "^7.14.5",
50
50
  "@babel/preset-typescript": "^7.16.5",
51
- "@griddo/core": "10.6.1",
51
+ "@griddo/core": "10.6.3",
52
52
  "@svgr/webpack": "^5.5.0",
53
53
  "babel-loader": "^8.0.6",
54
54
  "babel-plugin-transform-runtime": "^6.23.0",
@@ -119,5 +119,5 @@
119
119
  "publishConfig": {
120
120
  "access": "public"
121
121
  },
122
- "gitHead": "7c09ff5f84d88f828072c1e328345173f2cdf992"
122
+ "gitHead": "d921dd845629fd4f41cb067d6b2159d0110ca4a1"
123
123
  }