diff --git a/dist/index.js b/dist/index.js index ea0c0a56..3df78b00 100755 --- a/dist/index.js +++ b/dist/index.js @@ -984,7 +984,7 @@ You must use <@skeet-framework/firestore> to retrieve data from Firestore. catch (error) { throw new Error(\`findLargest: \${error}\`) } -}`}]}},sQ=async(c,g,d,p,h,s,a,f)=>{try{let b=uQ(d,p,h,s,a,f);return await fi(b,c,g.ai,g.aiInstance)}catch(b){throw new Error(`skeetNaming: ${b}`)}};dQ.config();var tl,kh=(tl=class{ai;model;maxTokens;temperature;_initOptions;aiInstance;functionConfigPaths=g=>({packageJson:`${tl.FUNCTION_ROOT}/${g}/package.json`,tsconfigJson:`${tl.FUNCTION_ROOT}/${g}/tsconfig.json`});constructor(g={}){this.ai=g.ai||"VertexAI",this.model=g.model||(this.ai==="VertexAI"?"chat-bison@001":"gpt-4"),this.maxTokens=g.maxTokens||1e3,this.temperature=g.temperature||0,this.ai==="VertexAI"?this.aiInstance=new Sd({model:this.model,maxOutputTokens:this.maxTokens}):this.aiInstance=new Od({model:this.model,maxTokens:this.maxTokens,apiKey:process.env.CHAT_GPT_KEY||"",organizationKey:process.env.CHAT_GPT_ORG||""}),this._initOptions=g}get initOptions(){return this._initOptions}async prisma(g){try{return await NH(g,this)}catch(d){this.handleError(d)}}async skeet(g){try{return await IH(g,this)}catch(d){throw new Error(`skeet: ${d}`)}}async uploadFile(g){try{return await xH(g,this.ai,this.aiInstance)}catch(d){this.handleError(d)}}async createFineTuningJob(g,d="gpt-3.5-turbo-0613"){try{return await EH(g,d,this.ai,this.aiInstance)}catch(p){this.handleError(p)}}async showFineTuningJob(g){try{return await MH(g,this.ai,this.aiInstance)}catch(d){this.handleError(d)}}async typedoc(g){try{return await UH(g,this)}catch(d){this.handleError(d)}}async naming(g,d="function"){try{return await zH(g,this,d)}catch(p){this.handleError(p)}}async translates(g,d="ja",p="en"){try{return await $H(g,d,p,this)}catch(h){this.handleError(h)}}async firestore(g){try{return await tQ(g,this)}catch(d){this.handleError(d)}}async function(g,d,p,h,s,a,f){try{return await sQ(g,this,d,p,h,s,a,f)}catch(b){this.handleError(b)}}async method(g,d,p,h,s,a){try{return await nQ(g,this,d,p,h,s,a)}catch(f){this.handleError(f)}}async run(g,d){try{let p=Ia(g.context,g.examples,d,this.ai);return this.ai==="VertexAI"?await this.aiInstance.prompt(p):await this.aiInstance.prompt(p)}catch(p){throw new Error(`run: ${p}`)}}handleError(g){console.error("Error:",g)}},B0(tl,"PRISMA_SCHEMA_PATH","./graphql/prisma/schema.prisma"),B0(tl,"MODEL_PATH","./functions/skeet/src/models"),B0(tl,"FUNCTION_ROOT","./functions"),tl),Cp=kh;});var _zt={};fke(_zt,{DEFAULT_FUNCTION_NAME:()=>fr,FIREBASERC_PATH:()=>S5,GRAPHQL_ENV_BUILD_PATH:()=>KI,GRAPHQL_ENV_PRODUCTION_PATH:()=>ti,GRAPHQL_PATH:()=>ea,GRAPHQL_ROOT:()=>Xo,PRISMA_SCHEMA_PATH:()=>Ps,SKEET_CONFIG_PATH:()=>Ep,TRANSLATE_PATH:()=>c$,program:()=>qt});module.exports=hke(_zt);var m_e=st(uA());var FY=st(AY(),1),{program:Uzt,createCommand:Vzt,createArgument:Gzt,createOption:zzt,CommanderError:Hzt,InvalidArgumentError:Qzt,InvalidOptionArgumentError:$zt,Command:_Y,Argument:Yzt,Option:Wzt,Help:Kzt}=FY.default;var kY="1.11.4";var MY=(c=0)=>g=>`\x1B[${g+c}m`,RY=(c=0)=>g=>`\x1B[${38+c};5;${g}m`,NY=(c=0)=>(g,d,p)=>`\x1B[${38+c};2;${g};${d};${p}m`,Ao={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},eHt=Object.keys(Ao.modifier),Vke=Object.keys(Ao.color),Gke=Object.keys(Ao.bgColor),tHt=[...Vke,...Gke];function zke(){let c=new Map;for(let[g,d]of Object.entries(Ao)){for(let[p,h]of Object.entries(d))Ao[p]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},d[p]=Ao[p],c.set(h[0],h[1]);Object.defineProperty(Ao,g,{value:d,enumerable:!1})}return Object.defineProperty(Ao,"codes",{value:c,enumerable:!1}),Ao.color.close="\x1B[39m",Ao.bgColor.close="\x1B[49m",Ao.color.ansi=MY(),Ao.color.ansi256=RY(),Ao.color.ansi16m=NY(),Ao.bgColor.ansi=MY(10),Ao.bgColor.ansi256=RY(10),Ao.bgColor.ansi16m=NY(10),Object.defineProperties(Ao,{rgbToAnsi256:{value(g,d,p){return g===d&&d===p?g<8?16:g>248?231:Math.round((g-8)/247*24)+232:16+36*Math.round(g/255*5)+6*Math.round(d/255*5)+Math.round(p/255*5)},enumerable:!1},hexToRgb:{value(g){let d=/[a-f\d]{6}|[a-f\d]{3}/i.exec(g.toString(16));if(!d)return[0,0,0];let[p]=d;p.length===3&&(p=[...p].map(s=>s+s).join(""));let h=Number.parseInt(p,16);return[h>>16&255,h>>8&255,h&255]},enumerable:!1},hexToAnsi256:{value:g=>Ao.rgbToAnsi256(...Ao.hexToRgb(g)),enumerable:!1},ansi256ToAnsi:{value(g){if(g<8)return 30+g;if(g<16)return 90+(g-8);let d,p,h;if(g>=232)d=((g-232)*10+8)/255,p=d,h=d;else{g-=16;let f=g%36;d=Math.floor(g/36)/5,p=Math.floor(f/6)/5,h=f%6/5}let s=Math.max(d,p,h)*2;if(s===0)return 30;let a=30+(Math.round(h)<<2|Math.round(p)<<1|Math.round(d));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(g,d,p)=>Ao.ansi256ToAnsi(Ao.rgbToAnsi256(g,d,p)),enumerable:!1},hexToAnsi:{value:g=>Ao.ansi256ToAnsi(Ao.hexToAnsi256(g)),enumerable:!1}}),Ao}var Hke=zke(),zn=Hke;var G0=st(require("node:process"),1),IY=st(require("node:os"),1),PA=st(require("node:tty"),1);function hn(c,g=globalThis.Deno?globalThis.Deno.args:G0.default.argv){let d=c.startsWith("-")?"":c.length===1?"-":"--",p=g.indexOf(d+c),h=g.indexOf("--");return p!==-1&&(h===-1||p=2,has16m:c>=3}}function Yke(c,{streamIsTTY:g,sniffFlags:d=!0}={}){let p=Qke();p!==void 0&&(V0=p);let h=d?V0:p;if(h===0)return 0;if(d){if(hn("color=16m")||hn("color=full")||hn("color=truecolor"))return 3;if(hn("color=256"))return 2}if("TF_BUILD"in Lo&&"AGENT_NAME"in Lo)return 1;if(c&&!g&&h===void 0)return 0;let s=h||0;if(Lo.TERM==="dumb")return s;if(G0.default.platform==="win32"){let a=IY.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Lo)return"GITHUB_ACTIONS"in Lo||"GITEA_ACTIONS"in Lo?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Lo)||Lo.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Lo)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Lo.TEAMCITY_VERSION)?1:0;if(Lo.COLORTERM==="truecolor"||Lo.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Lo){let a=Number.parseInt((Lo.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Lo.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Lo.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Lo.TERM)||"COLORTERM"in Lo?1:s}function BY(c,g={}){let d=Yke(c,{streamIsTTY:c&&c.isTTY,...g});return $ke(d)}var Wke={stdout:BY({isTTY:PA.default.isatty(1)}),stderr:BY({isTTY:PA.default.isatty(2)})},LY=Wke;function qY(c,g,d){let p=c.indexOf(g);if(p===-1)return c;let h=g.length,s=0,a="";do a+=c.slice(s,p)+g+d,s=p+h,p=c.indexOf(g,s);while(p!==-1);return a+=c.slice(s),a}function JY(c,g,d,p){let h=0,s="";do{let a=c[p-1]==="\r";s+=c.slice(h,a?p-1:p)+g+(a?`\r +}`}]}},sQ=async(c,g,d,p,h,s,a,f)=>{try{let b=uQ(d,p,h,s,a,f);return await fi(b,c,g.ai,g.aiInstance)}catch(b){throw new Error(`skeetNaming: ${b}`)}};dQ.config();var tl,kh=(tl=class{ai;model;maxTokens;temperature;_initOptions;aiInstance;functionConfigPaths=g=>({packageJson:`${tl.FUNCTION_ROOT}/${g}/package.json`,tsconfigJson:`${tl.FUNCTION_ROOT}/${g}/tsconfig.json`});constructor(g={}){this.ai=g.ai||"VertexAI",this.model=g.model||(this.ai==="VertexAI"?"chat-bison@001":"gpt-4"),this.maxTokens=g.maxTokens||1e3,this.temperature=g.temperature||0,this.ai==="VertexAI"?this.aiInstance=new Sd({model:this.model,maxOutputTokens:this.maxTokens}):this.aiInstance=new Od({model:this.model,maxTokens:this.maxTokens,apiKey:process.env.CHAT_GPT_KEY||"",organizationKey:process.env.CHAT_GPT_ORG||""}),this._initOptions=g}get initOptions(){return this._initOptions}async prisma(g){try{return await NH(g,this)}catch(d){this.handleError(d)}}async skeet(g){try{return await IH(g,this)}catch(d){throw new Error(`skeet: ${d}`)}}async uploadFile(g){try{return await xH(g,this.ai,this.aiInstance)}catch(d){this.handleError(d)}}async createFineTuningJob(g,d="gpt-3.5-turbo-0613"){try{return await EH(g,d,this.ai,this.aiInstance)}catch(p){this.handleError(p)}}async showFineTuningJob(g){try{return await MH(g,this.ai,this.aiInstance)}catch(d){this.handleError(d)}}async typedoc(g){try{return await UH(g,this)}catch(d){this.handleError(d)}}async naming(g,d="function"){try{return await zH(g,this,d)}catch(p){this.handleError(p)}}async translates(g,d="ja",p="en"){try{return await $H(g,d,p,this)}catch(h){this.handleError(h)}}async firestore(g){try{return await tQ(g,this)}catch(d){this.handleError(d)}}async function(g,d,p,h,s,a,f){try{return await sQ(g,this,d,p,h,s,a,f)}catch(b){this.handleError(b)}}async method(g,d,p,h,s,a){try{return await nQ(g,this,d,p,h,s,a)}catch(f){this.handleError(f)}}async run(g,d){try{let p=Ia(g.context,g.examples,d,this.ai);return this.ai==="VertexAI"?await this.aiInstance.prompt(p):await this.aiInstance.prompt(p)}catch(p){throw new Error(`run: ${p}`)}}handleError(g){console.error("Error:",g)}},B0(tl,"PRISMA_SCHEMA_PATH","./graphql/prisma/schema.prisma"),B0(tl,"MODEL_PATH","./functions/skeet/src/models"),B0(tl,"FUNCTION_ROOT","./functions"),tl),Cp=kh;});var _zt={};fke(_zt,{DEFAULT_FUNCTION_NAME:()=>fr,FIREBASERC_PATH:()=>S5,GRAPHQL_ENV_BUILD_PATH:()=>KI,GRAPHQL_ENV_PRODUCTION_PATH:()=>ti,GRAPHQL_PATH:()=>ea,GRAPHQL_ROOT:()=>Xo,PRISMA_SCHEMA_PATH:()=>Ps,SKEET_CONFIG_PATH:()=>Ep,TRANSLATE_PATH:()=>c$,program:()=>qt});module.exports=hke(_zt);var m_e=st(uA());var FY=st(AY(),1),{program:Uzt,createCommand:Vzt,createArgument:Gzt,createOption:zzt,CommanderError:Hzt,InvalidArgumentError:Qzt,InvalidOptionArgumentError:$zt,Command:_Y,Argument:Yzt,Option:Wzt,Help:Kzt}=FY.default;var kY="1.11.5";var MY=(c=0)=>g=>`\x1B[${g+c}m`,RY=(c=0)=>g=>`\x1B[${38+c};5;${g}m`,NY=(c=0)=>(g,d,p)=>`\x1B[${38+c};2;${g};${d};${p}m`,Ao={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},eHt=Object.keys(Ao.modifier),Vke=Object.keys(Ao.color),Gke=Object.keys(Ao.bgColor),tHt=[...Vke,...Gke];function zke(){let c=new Map;for(let[g,d]of Object.entries(Ao)){for(let[p,h]of Object.entries(d))Ao[p]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},d[p]=Ao[p],c.set(h[0],h[1]);Object.defineProperty(Ao,g,{value:d,enumerable:!1})}return Object.defineProperty(Ao,"codes",{value:c,enumerable:!1}),Ao.color.close="\x1B[39m",Ao.bgColor.close="\x1B[49m",Ao.color.ansi=MY(),Ao.color.ansi256=RY(),Ao.color.ansi16m=NY(),Ao.bgColor.ansi=MY(10),Ao.bgColor.ansi256=RY(10),Ao.bgColor.ansi16m=NY(10),Object.defineProperties(Ao,{rgbToAnsi256:{value(g,d,p){return g===d&&d===p?g<8?16:g>248?231:Math.round((g-8)/247*24)+232:16+36*Math.round(g/255*5)+6*Math.round(d/255*5)+Math.round(p/255*5)},enumerable:!1},hexToRgb:{value(g){let d=/[a-f\d]{6}|[a-f\d]{3}/i.exec(g.toString(16));if(!d)return[0,0,0];let[p]=d;p.length===3&&(p=[...p].map(s=>s+s).join(""));let h=Number.parseInt(p,16);return[h>>16&255,h>>8&255,h&255]},enumerable:!1},hexToAnsi256:{value:g=>Ao.rgbToAnsi256(...Ao.hexToRgb(g)),enumerable:!1},ansi256ToAnsi:{value(g){if(g<8)return 30+g;if(g<16)return 90+(g-8);let d,p,h;if(g>=232)d=((g-232)*10+8)/255,p=d,h=d;else{g-=16;let f=g%36;d=Math.floor(g/36)/5,p=Math.floor(f/6)/5,h=f%6/5}let s=Math.max(d,p,h)*2;if(s===0)return 30;let a=30+(Math.round(h)<<2|Math.round(p)<<1|Math.round(d));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(g,d,p)=>Ao.ansi256ToAnsi(Ao.rgbToAnsi256(g,d,p)),enumerable:!1},hexToAnsi:{value:g=>Ao.ansi256ToAnsi(Ao.hexToAnsi256(g)),enumerable:!1}}),Ao}var Hke=zke(),zn=Hke;var G0=st(require("node:process"),1),IY=st(require("node:os"),1),PA=st(require("node:tty"),1);function hn(c,g=globalThis.Deno?globalThis.Deno.args:G0.default.argv){let d=c.startsWith("-")?"":c.length===1?"-":"--",p=g.indexOf(d+c),h=g.indexOf("--");return p!==-1&&(h===-1||p=2,has16m:c>=3}}function Yke(c,{streamIsTTY:g,sniffFlags:d=!0}={}){let p=Qke();p!==void 0&&(V0=p);let h=d?V0:p;if(h===0)return 0;if(d){if(hn("color=16m")||hn("color=full")||hn("color=truecolor"))return 3;if(hn("color=256"))return 2}if("TF_BUILD"in Lo&&"AGENT_NAME"in Lo)return 1;if(c&&!g&&h===void 0)return 0;let s=h||0;if(Lo.TERM==="dumb")return s;if(G0.default.platform==="win32"){let a=IY.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Lo)return"GITHUB_ACTIONS"in Lo||"GITEA_ACTIONS"in Lo?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Lo)||Lo.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Lo)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Lo.TEAMCITY_VERSION)?1:0;if(Lo.COLORTERM==="truecolor"||Lo.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Lo){let a=Number.parseInt((Lo.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Lo.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Lo.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Lo.TERM)||"COLORTERM"in Lo?1:s}function BY(c,g={}){let d=Yke(c,{streamIsTTY:c&&c.isTTY,...g});return $ke(d)}var Wke={stdout:BY({isTTY:PA.default.isatty(1)}),stderr:BY({isTTY:PA.default.isatty(2)})},LY=Wke;function qY(c,g,d){let p=c.indexOf(g);if(p===-1)return c;let h=g.length,s=0,a="";do a+=c.slice(s,p)+g+d,s=p+h,p=c.indexOf(g,s);while(p!==-1);return a+=c.slice(s),a}function JY(c,g,d,p){let h=0,s="";do{let a=c[p-1]==="\r";s+=c.slice(h,a?p-1:p)+g+(a?`\r `:` `)+d,h=p+1,p=c.indexOf(` `,h)}while(p!==-1);return s+=c.slice(h),s}var{stdout:UY,stderr:VY}=LY,jA=Symbol("GENERATOR"),Nc=Symbol("STYLER"),Kf=Symbol("IS_EMPTY"),GY=["ansi","ansi","ansi256","ansi16m"],Ic=Object.create(null),Kke=(c,g={})=>{if(g.level&&!(Number.isInteger(g.level)&&g.level>=0&&g.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let d=UY?UY.level:0;c.level=g.level===void 0?d:g.level};var Xke=c=>{let g=(...d)=>d.join(" ");return Kke(g,c),Object.setPrototypeOf(g,Xf.prototype),g};function Xf(c){return Xke(c)}Object.setPrototypeOf(Xf.prototype,Function.prototype);for(let[c,g]of Object.entries(zn))Ic[c]={get(){let d=z0(this,EA(g.open,g.close,this[Nc]),this[Kf]);return Object.defineProperty(this,c,{value:d}),d}};Ic.visible={get(){let c=z0(this,this[Nc],!0);return Object.defineProperty(this,"visible",{value:c}),c}};var xA=(c,g,d,...p)=>c==="rgb"?g==="ansi16m"?zn[d].ansi16m(...p):g==="ansi256"?zn[d].ansi256(zn.rgbToAnsi256(...p)):zn[d].ansi(zn.rgbToAnsi(...p)):c==="hex"?xA("rgb",g,d,...zn.hexToRgb(...p)):zn[d][c](...p),Zke=["rgb","hex","ansi256"];for(let c of Zke){Ic[c]={get(){let{level:d}=this;return function(...p){let h=EA(xA(c,GY[d],"color",...p),zn.color.close,this[Nc]);return z0(this,h,this[Kf])}}};let g="bg"+c[0].toUpperCase()+c.slice(1);Ic[g]={get(){let{level:d}=this;return function(...p){let h=EA(xA(c,GY[d],"bgColor",...p),zn.bgColor.close,this[Nc]);return z0(this,h,this[Kf])}}}}var eMe=Object.defineProperties(()=>{},{...Ic,level:{enumerable:!0,get(){return this[jA].level},set(c){this[jA].level=c}}}),EA=(c,g,d)=>{let p,h;return d===void 0?(p=c,h=g):(p=d.openAll+c,h=g+d.closeAll),{open:c,close:g,openAll:p,closeAll:h,parent:d}},z0=(c,g,d)=>{let p=(...h)=>tMe(p,h.length===1?""+h[0]:h.join(" "));return Object.setPrototypeOf(p,eMe),p[jA]=c,p[Nc]=g,p[Kf]=d,p},tMe=(c,g)=>{if(c.level<=0||!g)return c[Kf]?"":g;let d=c[Nc];if(d===void 0)return g;let{openAll:p,closeAll:h}=d;if(g.includes("\x1B"))for(;d!==void 0;)g=qY(g,d.close,d.open),d=d.parent;let s=g.indexOf(` @@ -1024,7 +1024,7 @@ You must use <@skeet-framework/firestore> to retrieve data from Firestore. `),Ye.normal(`Please check if your project exsists. \u{1F449} https://console.firebase.google.com/project/${c} -`),new Error(`firebase project not found - ${g}`)}};var hS=require("fs"),Lce=async c=>{let g=(0,hS.readFileSync)(Z1),d=JSON.parse(String(g));d.hosting||(d.hosting=[]);let p={target:c,public:"web-build",ignore:["firebase.json","**/.*","**/node_modules/**"]};d.hosting.push(p),(0,hS.writeFileSync)(Z1,JSON.stringify(d,null,2)),Ye.successCheck("Successfully Updated firebase.json")};var qce=require("child_process"),Jce=async()=>{try{let c=(0,qce.spawn)("firebase",["login","--reauth"],{stdio:"inherit"});return c.on("error",g=>{throw new Error(`firebase login failed - ${g}`)}),c.on("exit",g=>{if(g!==0)throw new Error(`firebase login process exited with code ${g}`)}),new Promise((g,d)=>{c.on("exit",p=>{p!==0?d(new Error(`firebase login process exited with code ${p}`)):g()})})}catch(c){throw c}};var Uce=require("child_process"),yS=async c=>{await Vce(c,rmt)},bS=async c=>{await Vce(c,["aiplatform.googleapis.com","translate.googleapis.com","secretmanager.googleapis.com"])},Vce=async(c,g)=>{for await(let d of g)await Gce(c,d)},Gce=async(c,g)=>{let d=["gcloud","services","enable",g,"--project",c];(0,Uce.spawnSync)(d[0],d.slice(1),{stdio:"inherit"})},rmt=["compute.googleapis.com","iam.googleapis.com","dns.googleapis.com","sqladmin.googleapis.com","sql-component.googleapis.com","servicenetworking.googleapis.com","containerregistry.googleapis.com","artifactregistry.googleapis.com","run.googleapis.com","vpcaccess.googleapis.com","cloudscheduler.googleapis.com","cloudresourcemanager.googleapis.com","translate.googleapis.com","firestore.googleapis.com","cloudfunctions.googleapis.com","cloudtasks.googleapis.com","cloudbuild.googleapis.com","firebasehosting.googleapis.com","secretmanager.googleapis.com","firebaserules.googleapis.com","aiplatform.googleapis.com"];var vS=require("child_process"),hs=async(c,g)=>{try{let p=["gcloud","iam","service-accounts","describe",`${g}@${c}.iam.gserviceaccount.com`,"--project",c,'--format="value(email)"'].join(" ");console.log(p);let h=String((0,vS.execSync)(p));console.log(`Account exists: ${h}`)}catch{console.log("Service account does not exist, creating new one...");let p=["gcloud","iam","service-accounts","create",g,"--description='Skeet Framework Service Account'",`--display-name=${g}`,"--project",c];(0,vS.spawnSync)(p[0],p.slice(1),{stdio:"inherit"}),Ye.successCheck("Service account created successfully")}};var zce=require("child_process"),Hl=async(c,g)=>{let d=["gcloud","iam","service-accounts","keys","create",Fm,"--iam-account",`${g}@${c}.iam.gserviceaccount.com`,"--project",c];(0,zce.spawnSync)(d[0],d.slice(1),{stdio:"inherit"})};var Hce=require("child_process"),TS=async(c,g)=>{await Qce(c,g,amt)},OS=async(c,g)=>{await Qce(c,g,["roles/aiplatform.admin","roles/cloudtranslate.admin","roles/iam.serviceAccountUser"])},Qce=async(c,g,d)=>{for await(let p of d)await $ce(c,g,p)},$ce=async(c,g,d)=>{let p=["gcloud","projects","add-iam-policy-binding",c,"--member",`serviceAccount:${g}@${c}.iam.gserviceaccount.com`,"--role",d];(0,Hce.spawnSync)(p[0],p.slice(1),{stdio:"inherit"})},amt=["roles/cloudsql.editor","roles/containerregistry.ServiceAgent","roles/artifactregistry.admin","roles/pubsub.editor","roles/datastore.user","roles/iam.serviceAccountUser","roles/run.admin","roles/storage.admin","roles/storage.objectAdmin","roles/cloudscheduler.admin","roles/appengine.appCreator","roles/logging.admin","roles/cloudtranslate.admin","roles/compute.networkAdmin","roles/cloudfunctions.admin","roles/firebasehosting.admin","roles/secretmanager.admin","roles/cloudtasks.admin","roles/firebaserules.admin","roles/aiplatform.admin"];var Yce=require("child_process"),dr=async c=>{try{(0,Yce.execSync)(["gcloud","config","set","project",c].join(" "),{stdio:"ignore"})}catch(g){throw new Error(`setGcloudProject: ${g}`)}};var Wce=async(c,g)=>{let p=["gcloud","compute","networks","create",(await gt(c,g)).networkName,"--project",c];await Xe(p)};var Kce=async(c,g)=>{let p=["gcloud","compute","firewall-rules","create",(await gt(c,g)).firewallTcpName,"--allow","tcp,udp,icmp","--source-ranges",SS,"--project",c];await Xe(p)};var Xce=async(c,g)=>{let d=await gt(c,g),p=["gcloud","compute","firewall-rules","create",d.firewallSshName,"--network",d.networkName,"--allow","tcp:22,tcp:3389,icmp","--project",c];await Xe(p)};var Zce=async(c,g,d)=>{let p=await gt(c,g),h=["gcloud","compute","networks","subnets","create",p.subnetName,"--range",SS,"--network",p.networkName,"--region",d];await Xe(h)};var ede=async(c,g,d)=>{let p=await gt(c,g),h=["gcloud","compute","networks","vpc-access","connectors","create",p.connectorName,"--region",d,"--subnet-project",c,"--subnet",p.subnetName];await Xe(h)};var tde=async(c,g,d)=>{let p=await gt(c,g),h=["gcloud","compute","routers","create",p.routerName,"--network",p.networkName,"--region",d];await Xe(h)};var ode=require("child_process"),PS=async(c,g,d,p=!1)=>{let h=p?"--global":`--region=${g}`;await Xe(["gcloud","compute","addresses","create",d,h,"--project",c])},rde=async(c,g)=>{try{let p=String((0,ode.execSync)(["gcloud","compute","addresses","describe",g,'--format="get(address)"',"--global","--project",c].join(" "))).replace(/\r?\n/g,"");return console.log(p),p}catch(d){throw new Error(`getIp: ${JSON.stringify(String(d))}`)}};var ade=async(c,g,d)=>{let p=await gt(c,g),h=["gcloud","compute","routers","nats","create",p.natName,"--router",p.routerName,"--region",d,"--nat-custom-subnet-ip-ranges",p.subnetName,"--nat-external-ip-pool",p.ipName,"--project",c];await Xe(h)};var nde=async(c,g)=>{let d=await gt(c,g),p=["gcloud","compute","addresses","create",d.ipRangeName,"--global","--purpose","VPC_PEERING","--prefix-length","16","--description","Peering Range for Skeet APP","--network",d.networkName,"--project",c];await Xe(p)};var ide=async(c,g)=>{try{let d=await gt(c,g),p=["gcloud","services","vpc-peerings","connect","--service","servicenetworking.googleapis.com","--ranges",d.ipRangeName,"--network",d.networkName,"--project",c];await Xe(p)}catch(d){throw new Error(`connectVpc: ${d}`)}};var _m=async(c,g,d)=>{await Wce(c,g),await Kce(c,g),await Xce(c,g),await Zce(c,g,d),await ede(c,g,d),await tde(c,g,d);let{ipName:p}=await gt(c,g);await PS(c,d,p),await ade(c,g,d),await nde(c,g),await ide(c,g)};var wN=require("fs"),lt=async()=>{try{let c=(0,wN.readFileSync)("./skeet-cloud.config.json");return JSON.parse(String(c))}catch(c){console.log(c),process.exit(1)}},sde=async()=>{try{let c=(0,wN.readFileSync)("./firebase.json");return JSON.parse(String(c))}catch(c){console.log(c),process.exit(1)}};var ai=require("fs");var DN=require("child_process");var Mm=st(require("fs"));var Ft="./functions",Z1="./firebase.json",pa="./skeet-cloud.config.json",Rm="./package.json";var lde="https://github.com/elsoul/skeet-functions",ude="https://github.com/elsoul/skeet-app",pde="https://github.com/elsoul/skeet-graphql",cde="https://github.com/elsoul/skeet-next",dde="https://github.com/elsoul/skeet-graphql-only",mde="https://github.com/elsoul/skeet-functions-only",gde="https://github.com/elsoul/skeet-solana-mobile-stack";var jS="./webapp",Fm="./keyfile.json";var Hr=async c=>({name:`skeet-functions-${c}`,neg:`skeet-${c}-neg`,backendService:`skeet-${c}-bs`,armor:`skeet-${c}-armor`}),fde=c=>{try{let g=Mm.default.readFileSync("./tsconfig.json","utf-8"),d=Mm.default.readFileSync(".prettierrc","utf-8");return{package:nmt(c,"package.json"),tsconfig:g,prretierrc:d}}catch(g){throw new Error(`getFunctionConfig: ${g}`)}},nmt=(c,g)=>{try{let d=`${Ft}/${c}/${g}`;return console.log(d),Mm.default.readFileSync(d,"utf-8")}catch{return""}},gt=async(c,g)=>{let d="skeet-"+g;return{projectId:c,appName:g,cloudRunName:`${d}-api`,instanceName:d+"-db",networkName:d+"-network",firewallTcpName:d+"-fw-tcp",firewallSshName:d+"-fw-ssh",natName:d+"-nat",routerName:d+"-router",subnetName:d+"-subnet",connectorName:g+"-con",ipName:d+"-external-ip",loadBalancerIpName:d+"-lb-ip",ipRangeName:d+"-ip-range",serviceAccountName:`${g}@${c}.iam.gserviceaccount.com`,networkEndpointGroupName:`${d}-neg`,defaultBackendServiceName:`${d}-default-bs`,backendServiceName:`${d}-bs`,loadBalancerName:`${d}-lb`,sslName:`${d}-ssl`,proxyName:`${d}-px`,forwardingRuleName:`${d}-fr`,zoneName:`${d}-zone`,securityPolicyName:`${d}-armor`,pathMatcherName:`${d}-pm`}},ey=async c=>{switch(c){case c.match("asia")?.input:return"asia.gcr.io";case c.match("eu")?.input:return"eu.gcr.io";default:return"gcr.io"}},Xu=async(c,g,d,p="",h=!1)=>{let s=await ey(d),a="";p!==""&&h?a="skeet-worker-"+p:p!==""?a="skeet-"+g+"-worker-"+p:a="skeet-"+g+"-api";let f=h?"skeet-framework":c;return s+"/"+f+"/"+a+":latest"},Zu=async(c,g="")=>g!==""?"skeet-"+c+"-worker-"+g:"skeet-"+c+"-graphql",hde=async c=>{switch(!0){case c.includes("asia"):return"Asia/Tokyo";case c.includes("europe"):return"Europe/Amsterdam";default:return"America/Los_Angeles"}},yde=async(c,g)=>{try{let d=(await gt(c,g)).cloudRunName;console.log(d);let p=`gcloud run services list --project=${c} | grep ${d} | awk '{print $4}'`;return String((0,DN.execSync)(p)).replace(/\r?\n/g,"")}catch{return""}},bde=async(c,g,d)=>{let{neg:p}=await Hr(d),h=["gcloud","compute","network-endpoint-groups","describe",p,"--region",g,"--project",c];try{if(String((0,DN.execSync)(h.join(" "),{stdio:"ignore"})).includes("ERROR:"))throw new Error("does not exist");return!0}catch{return!1}},imt=["NO_PEER_DEPENDENCY_CHECK=1","DATABASE_URL=postgresql://postgres:${{ secrets.SKEET_GCP_DB_PASSWORD }}@${{ secrets.SKEET_GCP_DB_PRIVATE_IP }}:5432/skeet-${{ secrets.SKEET_APP_NAME }}-production?schema=public","SKEET_GCP_PROJECT_ID=${{ secrets.SKEET_GCP_PROJECT_ID }}","SKEET_GCP_TASK_REGION=${{ secrets.SKEET_GCP_TASK_REGION }}","GOOGLE_CLOUD_PROJECT=${{ secrets.SKEET_FB_PROJECT_ID }}","SKEET_API_ENDPOINT_URL=${{ secrets.SKEET_API_ENDPOINT_URL }}","TZ=${{ secrets.TZ }}"],smt=async(c,g,d,p)=>["NO_PEER_DEPENDENCY_CHECK=1",`SKEET_GCP_PROJECT_ID=${c}`,`SKEET_FB_PROJECT_ID=${g}`,`TZ=${p}`,`DATABASE_URL=${d}`],vde=async c=>{let g=Mm.default.readFileSync(c),d=String(g).split(` +`),new Error(`firebase project not found - ${g}`)}};var hS=require("fs"),Lce=async c=>{let g=(0,hS.readFileSync)(Z1),d=JSON.parse(String(g));d.hosting||(d.hosting=[]);let p={target:c,public:"web-build",ignore:["firebase.json","**/.*","**/node_modules/**"]};d.hosting.push(p),(0,hS.writeFileSync)(Z1,JSON.stringify(d,null,2)),Ye.successCheck("Successfully Updated firebase.json")};var qce=require("child_process"),Jce=async()=>{try{let c=(0,qce.spawn)("firebase",["login","--reauth"],{stdio:"inherit"});return c.on("error",g=>{throw new Error(`firebase login failed - ${g}`)}),c.on("exit",g=>{if(g!==0)throw new Error(`firebase login process exited with code ${g}`)}),new Promise((g,d)=>{c.on("exit",p=>{p!==0?d(new Error(`firebase login process exited with code ${p}`)):g()})})}catch(c){throw c}};var Uce=require("child_process"),yS=async c=>{await Vce(c,rmt)},bS=async c=>{await Vce(c,["aiplatform.googleapis.com","translate.googleapis.com","secretmanager.googleapis.com"])},Vce=async(c,g)=>{for await(let d of g)await Gce(c,d)},Gce=async(c,g)=>{let d=["gcloud","services","enable",g,"--project",c];(0,Uce.spawnSync)(d[0],d.slice(1),{stdio:"inherit"})},rmt=["compute.googleapis.com","iam.googleapis.com","dns.googleapis.com","sqladmin.googleapis.com","sql-component.googleapis.com","servicenetworking.googleapis.com","containerregistry.googleapis.com","artifactregistry.googleapis.com","run.googleapis.com","vpcaccess.googleapis.com","cloudscheduler.googleapis.com","cloudresourcemanager.googleapis.com","translate.googleapis.com","firestore.googleapis.com","cloudfunctions.googleapis.com","cloudtasks.googleapis.com","cloudbuild.googleapis.com","firebasehosting.googleapis.com","secretmanager.googleapis.com","firebaserules.googleapis.com","aiplatform.googleapis.com"];var vS=require("child_process"),hs=async(c,g)=>{try{let p=["gcloud","iam","service-accounts","describe",`${g}@${c}.iam.gserviceaccount.com`,"--project",c,'--format="value(email)"'].join(" ");console.log(p);let h=String((0,vS.execSync)(p));console.log(`Account exists: ${h}`)}catch{console.log("Service account does not exist, creating new one...");let p=["gcloud","iam","service-accounts","create",g,"--description='Skeet Framework Service Account'",`--display-name=${g}`,"--project",c];(0,vS.spawnSync)(p[0],p.slice(1),{stdio:"inherit"}),Ye.successCheck("Service account created successfully")}};var zce=require("child_process"),Hl=async(c,g)=>{let d=["gcloud","iam","service-accounts","keys","create",Fm,"--iam-account",`${g}@${c}.iam.gserviceaccount.com`,"--project",c];(0,zce.spawnSync)(d[0],d.slice(1),{stdio:"inherit"})};var Hce=require("child_process"),TS=async(c,g)=>{await Qce(c,g,amt)},OS=async(c,g)=>{await Qce(c,g,["roles/aiplatform.admin","roles/cloudtranslate.admin","roles/iam.serviceAccountUser"])},Qce=async(c,g,d)=>{for await(let p of d)await $ce(c,g,p)},$ce=async(c,g,d)=>{let p=["gcloud","projects","add-iam-policy-binding",c,"--member",`serviceAccount:${g}@${c}.iam.gserviceaccount.com`,"--role",d];(0,Hce.spawnSync)(p[0],p.slice(1),{stdio:"inherit"})},amt=["roles/cloudsql.editor","roles/containerregistry.ServiceAgent","roles/artifactregistry.admin","roles/pubsub.editor","roles/datastore.user","roles/iam.serviceAccountUser","roles/run.admin","roles/storage.admin","roles/storage.objectAdmin","roles/cloudscheduler.admin","roles/appengine.appCreator","roles/logging.admin","roles/cloudtranslate.admin","roles/compute.networkAdmin","roles/cloudfunctions.admin","roles/firebasehosting.admin","roles/secretmanager.admin","roles/cloudtasks.admin","roles/firebaserules.admin","roles/aiplatform.admin"];var Yce=require("child_process"),dr=async c=>{try{(0,Yce.execSync)(["gcloud","config","set","project",c].join(" "),{stdio:"ignore"})}catch(g){throw new Error(`setGcloudProject: ${g}`)}};var Wce=async(c,g)=>{let p=["gcloud","compute","networks","create",(await gt(c,g)).networkName,"--project",c];await Xe(p)};var Kce=async(c,g)=>{let p=["gcloud","compute","firewall-rules","create",(await gt(c,g)).firewallTcpName,"--allow","tcp,udp,icmp","--source-ranges",SS,"--project",c];await Xe(p)};var Xce=async(c,g)=>{let d=await gt(c,g),p=["gcloud","compute","firewall-rules","create",d.firewallSshName,"--network",d.networkName,"--allow","tcp:22,tcp:3389,icmp","--project",c];await Xe(p)};var Zce=async(c,g,d)=>{let p=await gt(c,g),h=["gcloud","compute","networks","subnets","create",p.subnetName,"--range",SS,"--network",p.networkName,"--region",d];await Xe(h)};var ede=async(c,g,d)=>{let p=await gt(c,g),h=["gcloud","compute","networks","vpc-access","connectors","create",p.connectorName,"--region",d,"--subnet-project",c,"--subnet",p.subnetName];await Xe(h)};var tde=async(c,g,d)=>{let p=await gt(c,g),h=["gcloud","compute","routers","create",p.routerName,"--network",p.networkName,"--region",d];await Xe(h)};var ode=require("child_process"),PS=async(c,g,d,p=!1)=>{let h=p?"--global":`--region=${g}`;await Xe(["gcloud","compute","addresses","create",d,h,"--project",c])},rde=async(c,g)=>{try{let p=String((0,ode.execSync)(["gcloud","compute","addresses","describe",g,'--format="get(address)"',"--global","--project",c].join(" "))).replace(/\r?\n/g,"");return console.log(p),p}catch(d){throw new Error(`getIp: ${JSON.stringify(String(d))}`)}};var ade=async(c,g,d)=>{let p=await gt(c,g),h=["gcloud","compute","routers","nats","create",p.natName,"--router",p.routerName,"--region",d,"--nat-custom-subnet-ip-ranges",p.subnetName,"--nat-external-ip-pool",p.ipName,"--project",c];await Xe(h)};var nde=async(c,g)=>{let d=await gt(c,g),p=["gcloud","compute","addresses","create",d.ipRangeName,"--global","--purpose","VPC_PEERING","--prefix-length","16","--description","Peering Range for Skeet APP","--network",d.networkName,"--project",c];await Xe(p)};var ide=async(c,g)=>{try{let d=await gt(c,g),p=["gcloud","services","vpc-peerings","connect","--service","servicenetworking.googleapis.com","--ranges",d.ipRangeName,"--network",d.networkName,"--project",c];await Xe(p)}catch(d){throw new Error(`connectVpc: ${d}`)}};var _m=async(c,g,d)=>{await Wce(c,g),await Kce(c,g),await Xce(c,g),await Zce(c,g,d),await ede(c,g,d),await tde(c,g,d);let{ipName:p}=await gt(c,g);await PS(c,d,p),await ade(c,g,d),await nde(c,g),await ide(c,g)};var wN=require("fs"),lt=async()=>{try{let c=(0,wN.readFileSync)("./skeet-cloud.config.json");return JSON.parse(String(c))}catch(c){console.log(c),process.exit(1)}},sde=async()=>{try{let c=(0,wN.readFileSync)("./firebase.json");return JSON.parse(String(c))}catch(c){console.log(c),process.exit(1)}};var ai=require("fs");var DN=require("child_process");var Mm=st(require("fs"));var Ft="./functions",Z1="./firebase.json",pa="./skeet-cloud.config.json",Rm="./package.json";var lde="https://github.com/elsoul/skeet-functions",ude="https://github.com/elsoul/skeet-app",pde="https://github.com/elsoul/skeet-graphql",cde="https://github.com/elsoul/skeet-next",dde="https://github.com/elsoul/skeet-graphql-only",mde="https://github.com/elsoul/skeet-functions-only",gde="https://github.com/elsoul/skeet-solana-mobile-stack";var jS="./webapp",Fm="./keyfile.json";var Hr=async c=>({name:`skeet-functions-${c}`,neg:`skeet-${c}-neg`,backendService:`skeet-${c}-bs`,armor:`skeet-${c}-armor`}),fde=c=>{try{let g=Mm.default.readFileSync("./tsconfig.json","utf-8"),d=Mm.default.readFileSync(".prettierrc","utf-8");return{package:nmt(c,"package.json"),tsconfig:g,prretierrc:d}}catch(g){throw new Error(`getFunctionConfig: ${g}`)}},nmt=(c,g)=>{try{let d=`${Ft}/${c}/${g}`;return Mm.default.readFileSync(d,"utf-8")}catch{return""}},gt=async(c,g)=>{let d="skeet-"+g;return{projectId:c,appName:g,cloudRunName:`${d}-api`,instanceName:d+"-db",networkName:d+"-network",firewallTcpName:d+"-fw-tcp",firewallSshName:d+"-fw-ssh",natName:d+"-nat",routerName:d+"-router",subnetName:d+"-subnet",connectorName:g+"-con",ipName:d+"-external-ip",loadBalancerIpName:d+"-lb-ip",ipRangeName:d+"-ip-range",serviceAccountName:`${g}@${c}.iam.gserviceaccount.com`,networkEndpointGroupName:`${d}-neg`,defaultBackendServiceName:`${d}-default-bs`,backendServiceName:`${d}-bs`,loadBalancerName:`${d}-lb`,sslName:`${d}-ssl`,proxyName:`${d}-px`,forwardingRuleName:`${d}-fr`,zoneName:`${d}-zone`,securityPolicyName:`${d}-armor`,pathMatcherName:`${d}-pm`}},ey=async c=>{switch(c){case c.match("asia")?.input:return"asia.gcr.io";case c.match("eu")?.input:return"eu.gcr.io";default:return"gcr.io"}},Xu=async(c,g,d,p="",h=!1)=>{let s=await ey(d),a="";p!==""&&h?a="skeet-worker-"+p:p!==""?a="skeet-"+g+"-worker-"+p:a="skeet-"+g+"-api";let f=h?"skeet-framework":c;return s+"/"+f+"/"+a+":latest"},Zu=async(c,g="")=>g!==""?"skeet-"+c+"-worker-"+g:"skeet-"+c+"-graphql",hde=async c=>{switch(!0){case c.includes("asia"):return"Asia/Tokyo";case c.includes("europe"):return"Europe/Amsterdam";default:return"America/Los_Angeles"}},yde=async(c,g)=>{try{let d=(await gt(c,g)).cloudRunName;console.log(d);let p=`gcloud run services list --project=${c} | grep ${d} | awk '{print $4}'`;return String((0,DN.execSync)(p)).replace(/\r?\n/g,"")}catch{return""}},bde=async(c,g,d)=>{let{neg:p}=await Hr(d),h=["gcloud","compute","network-endpoint-groups","describe",p,"--region",g,"--project",c];try{if(String((0,DN.execSync)(h.join(" "),{stdio:"ignore"})).includes("ERROR:"))throw new Error("does not exist");return!0}catch{return!1}},imt=["NO_PEER_DEPENDENCY_CHECK=1","DATABASE_URL=postgresql://postgres:${{ secrets.SKEET_GCP_DB_PASSWORD }}@${{ secrets.SKEET_GCP_DB_PRIVATE_IP }}:5432/skeet-${{ secrets.SKEET_APP_NAME }}-production?schema=public","SKEET_GCP_PROJECT_ID=${{ secrets.SKEET_GCP_PROJECT_ID }}","SKEET_GCP_TASK_REGION=${{ secrets.SKEET_GCP_TASK_REGION }}","GOOGLE_CLOUD_PROJECT=${{ secrets.SKEET_FB_PROJECT_ID }}","SKEET_API_ENDPOINT_URL=${{ secrets.SKEET_API_ENDPOINT_URL }}","TZ=${{ secrets.TZ }}"],smt=async(c,g,d,p)=>["NO_PEER_DEPENDENCY_CHECK=1",`SKEET_GCP_PROJECT_ID=${c}`,`SKEET_FB_PROJECT_ID=${g}`,`TZ=${p}`,`DATABASE_URL=${d}`],vde=async c=>{let g=Mm.default.readFileSync(c),d=String(g).split(` `),p=[];for await(let s of d){let a=s.match(/([A-Z_]+)="?([^"]*)"?/);if(a){if(a[1].match("SKEET_")||a[1]==="TZ")continue;let f=`${a[1]}=\${{ secrets.${a[1]} }}`;p.push(f)}}return imt.concat(p).join(",")},Tde=async()=>{let c=Mm.default.readFileSync(ti),g=String(c).split(` `),d={};for await(let f of g){let b=f.split("=");d[b[0]]=b[1]}let p=`postgresql://postgres:${d.SKEET_GCP_DB_PASSWORD}@${d.SKEET_GCP_DB_PRIVATE_IP}:5432/skeet-${d.SKEET_APP_NAME}-production?schema=public`,h=await smt(d.SKEET_GCP_PROJECT_ID,d.GOOGLE_CLOUD_PROJECT,p,d.TZ),s=g.filter(f=>{if(!f.match("SKEET_GCP_PROJECT_ID")&&!f.match("SKEET_GCP_DB_PASSWORD"))return f});return h.concat(s).join(",")};var Ode=(c=0)=>g=>`\x1B[${g+c}m`,Sde=(c=0)=>g=>`\x1B[${38+c};5;${g}m`,Pde=(c=0)=>(g,d,p)=>`\x1B[${38+c};2;${g};${d};${p}m`,Ro={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},jde=Object.keys(Ro.modifier),AN=Object.keys(Ro.color),FN=Object.keys(Ro.bgColor),xde=[...AN,...FN];function lmt(){let c=new Map;for(let[g,d]of Object.entries(Ro)){for(let[p,h]of Object.entries(d))Ro[p]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},d[p]=Ro[p],c.set(h[0],h[1]);Object.defineProperty(Ro,g,{value:d,enumerable:!1})}return Object.defineProperty(Ro,"codes",{value:c,enumerable:!1}),Ro.color.close="\x1B[39m",Ro.bgColor.close="\x1B[49m",Ro.color.ansi=Ode(),Ro.color.ansi256=Sde(),Ro.color.ansi16m=Pde(),Ro.bgColor.ansi=Ode(10),Ro.bgColor.ansi256=Sde(10),Ro.bgColor.ansi16m=Pde(10),Object.defineProperties(Ro,{rgbToAnsi256:{value(g,d,p){return g===d&&d===p?g<8?16:g>248?231:Math.round((g-8)/247*24)+232:16+36*Math.round(g/255*5)+6*Math.round(d/255*5)+Math.round(p/255*5)},enumerable:!1},hexToRgb:{value(g){let d=/[a-f\d]{6}|[a-f\d]{3}/i.exec(g.toString(16));if(!d)return[0,0,0];let[p]=d;p.length===3&&(p=[...p].map(s=>s+s).join(""));let h=Number.parseInt(p,16);return[h>>16&255,h>>8&255,h&255]},enumerable:!1},hexToAnsi256:{value:g=>Ro.rgbToAnsi256(...Ro.hexToRgb(g)),enumerable:!1},ansi256ToAnsi:{value(g){if(g<8)return 30+g;if(g<16)return 90+(g-8);let d,p,h;if(g>=232)d=((g-232)*10+8)/255,p=d,h=d;else{g-=16;let f=g%36;d=Math.floor(g/36)/5,p=Math.floor(f/6)/5,h=f%6/5}let s=Math.max(d,p,h)*2;if(s===0)return 30;let a=30+(Math.round(h)<<2|Math.round(p)<<1|Math.round(d));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(g,d,p)=>Ro.ansi256ToAnsi(Ro.rgbToAnsi256(g,d,p)),enumerable:!1},hexToAnsi:{value:g=>Ro.ansi256ToAnsi(Ro.hexToAnsi256(g)),enumerable:!1}}),Ro}var umt=lmt(),oi=umt;var ES=st(require("node:process"),1),wde=st(require("node:os"),1),_N=st(require("node:tty"),1);function Fn(c,g=globalThis.Deno?globalThis.Deno.args:ES.default.argv){let d=c.startsWith("-")?"":c.length===1?"-":"--",p=g.indexOf(d+c),h=g.indexOf("--");return p!==-1&&(h===-1||p=2,has16m:c>=3}}function dmt(c,{streamIsTTY:g,sniffFlags:d=!0}={}){let p=pmt();p!==void 0&&(xS=p);let h=d?xS:p;if(h===0)return 0;if(d){if(Fn("color=16m")||Fn("color=full")||Fn("color=truecolor"))return 3;if(Fn("color=256"))return 2}if("TF_BUILD"in $o&&"AGENT_NAME"in $o)return 1;if(c&&!g&&h===void 0)return 0;let s=h||0;if($o.TERM==="dumb")return s;if(ES.default.platform==="win32"){let a=wde.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in $o)return"GITHUB_ACTIONS"in $o?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in $o)||$o.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in $o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($o.TEAMCITY_VERSION)?1:0;if($o.COLORTERM==="truecolor"||$o.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in $o){let a=Number.parseInt(($o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($o.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($o.TERM)||"COLORTERM"in $o?1:s}function Ede(c,g={}){let d=dmt(c,{streamIsTTY:c&&c.isTTY,...g});return cmt(d)}var mmt={stdout:Ede({isTTY:_N.default.isatty(1)}),stderr:Ede({isTTY:_N.default.isatty(2)})},Cde=mmt;function Dde(c,g,d){let p=c.indexOf(g);if(p===-1)return c;let h=g.length,s=0,a="";do a+=c.slice(s,p)+g+d,s=p+h,p=c.indexOf(g,s);while(p!==-1);return a+=c.slice(s),a}function Ade(c,g,d,p){let h=0,s="";do{let a=c[p-1]==="\r";s+=c.slice(h,a?p-1:p)+g+(a?`\r `:` diff --git a/package.json b/package.json index 03d5a969..797852fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skeet-framework/cli", - "version": "1.11.4", + "version": "1.11.5", "description": "Skeet CLI", "main": "dist/index.js", "repository": "https://github.com/elsoul/skeet-cli", diff --git a/src/lib/version.ts b/src/lib/version.ts index fd95e0a1..0b8cb81b 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -1 +1 @@ -export const VERSION = '1.11.4' \ No newline at end of file +export const VERSION = '1.11.5' \ No newline at end of file