@capgo/cli 7.81.0 → 7.81.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/index.js +2 -2
- package/dist/package.json +1 -1
- package/dist/src/sdk.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1113,7 +1113,6 @@ npx @capgo/cli@latest build request com.example.app --platform ios --path .
|
|
|
1113
1113
|
| **--path** | <code>string</code> | Path to the project directory to build (default: current directory) |
|
|
1114
1114
|
| **--platform** | <code>string</code> | Target platform: ios or android (required) |
|
|
1115
1115
|
| **--build-mode** | <code>string</code> | Build mode: debug or release (default: release) |
|
|
1116
|
-
| **--build-config** | <code>string</code> | Additional build configuration as JSON string |
|
|
1117
1116
|
| **--build-certificate-base64** | <code>string</code> | iOS: Base64-encoded .p12 certificate |
|
|
1118
1117
|
| **--build-provision-profile-base64** | <code>string</code> | iOS: Base64-encoded provisioning profile |
|
|
1119
1118
|
| **--build-provision-profile-base64-prod** | <code>string</code> | iOS: Base64-encoded production provisioning profile |
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycl
|
|
|
24
24
|
`),this.outputHelp({error:!0});let X=D||{},J=X.exitCode||1,Y=X.code||"commander.error";this._exit(J,Y,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in B$.env){let D=$.attributeName();if(this.getOptionValue(D)===void 0||["default","config","env"].includes(this.getOptionValueSource(D)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,B$.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new Qt(this.options),D=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&D(X.attributeName())&&$.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((J)=>!D(J)).forEach((J)=>{this.setOptionValueWithSource(J,X.implied[J],"implied")})})}missingArgument($){let D=`error: missing required argument '${$}'`;this.error(D,{code:"commander.missingArgument"})}optionMissingArgument($){let D=`error: option '${$.flags}' argument missing`;this.error(D,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let D=`error: required option '${$.flags}' not specified`;this.error(D,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,D){let X=(Q)=>{let G=Q.attributeName(),W=this.getOptionValue(G),B=this.options.find((U)=>U.negate&&G===U.attributeName()),H=this.options.find((U)=>!U.negate&&G===U.attributeName());if(B&&(B.presetArg===void 0&&W===!1||B.presetArg!==void 0&&W===B.presetArg))return B;return H||Q},J=(Q)=>{let G=X(Q),W=G.attributeName();if(this.getOptionValueSource(W)==="env")return`environment variable '${G.envVar}'`;return`option '${G.flags}'`},Y=`error: ${J($)} cannot be used with ${J(D)}`;this.error(Y,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let D="";if($.startsWith("--")&&this._showSuggestionAfterError){let J=[],Y=this;do{let Q=Y.createHelp().visibleOptions(Y).filter((G)=>G.long).map((G)=>G.long);J=J.concat(Q),Y=Y.parent}while(Y&&!Y._enablePositionalOptions);D=Qj($,J)}let X=`error: unknown option '${$}'${D}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let D=this.registeredArguments.length,X=D===1?"":"s",Y=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${D} argument${X} but got ${$.length}.`;this.error(Y,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],D="";if(this._showSuggestionAfterError){let J=[];this.createHelp().visibleCommands(this).forEach((Y)=>{if(J.push(Y.name()),Y.alias())J.push(Y.alias())}),D=Qj($,J)}let X=`error: unknown command '${$}'${D}`;this.error(X,{code:"commander.unknownCommand"})}version($,D,X){if($===void 0)return this._version;this._version=$,D=D||"-V, --version",X=X||"output the version number";let J=this.createOption(D,X);return this._versionOptionName=J.attributeName(),this._registerOption(J),this.on("option:"+J.name(),()=>{this._outputConfiguration.writeOut(`${$}
|
|
25
25
|
`),this._exit(0,"commander.version",$)}),this}description($,D){if($===void 0&&D===void 0)return this._description;if(this._description=$,D)this._argsDescription=D;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let D=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)D=this.commands[this.commands.length-1];if($===D._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand($);if(X){let J=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${J}'`)}return D._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((D)=>this.alias(D)),this}usage($){if($===void 0){if(this._usage)return this._usage;let D=this.registeredArguments.map((X)=>{return Xt(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?D:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=l6.basename($,l6.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let D=this.createHelp(),X=this._getOutputContext($);D.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let J=D.formatHelp(this,D);if(X.hasColors)return J;return this._outputConfiguration.stripColor(J)}_getOutputContext($){$=$||{};let D=!!$.error,X,J,Y;if(D)X=(G)=>this._outputConfiguration.writeErr(G),J=this._outputConfiguration.getErrHasColors(),Y=this._outputConfiguration.getErrHelpWidth();else X=(G)=>this._outputConfiguration.writeOut(G),J=this._outputConfiguration.getOutHasColors(),Y=this._outputConfiguration.getOutHelpWidth();return{error:D,write:(G)=>{if(!J)G=this._outputConfiguration.stripColor(G);return X(G)},hasColors:J,helpWidth:Y}}outputHelp($){let D;if(typeof $==="function")D=$,$=void 0;let X=this._getOutputContext($),J={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",J)),this.emit("beforeHelp",J);let Y=this.helpInformation({error:X.error});if(D){if(Y=D(Y),typeof Y!=="string"&&!Buffer.isBuffer(Y))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write(Y),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",J),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",J))}helpOption($,D){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",D??"display help for command"),$||D)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let D=Number(B$.exitCode??0);if(D===0&&$&&typeof $!=="function"&&$.error)D=1;this._exit(D,"commander.help","(outputHelp)")}addHelpText($,D){let X=["beforeAll","before","after","afterAll"];if(!X.includes($))throw Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${X.join("', '")}'`);let J=`${$}Help`;return this.on(J,(Y)=>{let Q;if(typeof D==="function")Q=D({error:Y.error,command:Y.command});else Q=D;if(Q)Y.write(`${Q}
|
|
27
|
-
`)}),this}_outputHelpIfRequested($){let D=this._getHelpOption();if(D&&$.find((J)=>D.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Gj($){return $.map((D)=>{if(!D.startsWith("--inspect"))return D;let X,J="127.0.0.1",Y="9229",Q;if((Q=D.match(/^(--inspect(-brk)?)$/))!==null)X=Q[1];else if((Q=D.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=Q[1],/^\d+$/.test(Q[3]))Y=Q[3];else J=Q[3];else if((Q=D.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=Q[1],J=Q[3],Y=Q[4];if(X&&Y!=="0")return`${X}=${J}:${parseInt(Y)+1}`;return D})}function BK(){if(B$.env.NO_COLOR||B$.env.FORCE_COLOR==="0"||B$.env.FORCE_COLOR==="false")return!1;if(B$.env.FORCE_COLOR||B$.env.CLICOLOR_FORCE!==void 0)return!0;return}Gt.Command=HK;Gt.useColor=BK});var Fj=T((Ft)=>{var{Argument:Bj}=SQ(),{Command:UK}=Wj(),{CommanderError:Ht,InvalidArgumentError:Hj}=b7(),{Help:Ut}=JK(),{Option:Uj}=QK();Ft.program=new UK;Ft.createCommand=($)=>new UK($);Ft.createOption=($,D)=>new Uj($,D);Ft.createArgument=($,D)=>new Bj($,D);Ft.Command=UK;Ft.Option=Uj;Ft.Argument=Bj;Ft.Help=Ut;Ft.CommanderError=Ht;Ft.InvalidArgumentError=Hj;Ft.InvalidOptionArgumentError=Hj});var GD;var h9=c(()=>{GD={name:"@capgo/cli",type:"module",version:"7.81.
|
|
27
|
+
`)}),this}_outputHelpIfRequested($){let D=this._getHelpOption();if(D&&$.find((J)=>D.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Gj($){return $.map((D)=>{if(!D.startsWith("--inspect"))return D;let X,J="127.0.0.1",Y="9229",Q;if((Q=D.match(/^(--inspect(-brk)?)$/))!==null)X=Q[1];else if((Q=D.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=Q[1],/^\d+$/.test(Q[3]))Y=Q[3];else J=Q[3];else if((Q=D.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=Q[1],J=Q[3],Y=Q[4];if(X&&Y!=="0")return`${X}=${J}:${parseInt(Y)+1}`;return D})}function BK(){if(B$.env.NO_COLOR||B$.env.FORCE_COLOR==="0"||B$.env.FORCE_COLOR==="false")return!1;if(B$.env.FORCE_COLOR||B$.env.CLICOLOR_FORCE!==void 0)return!0;return}Gt.Command=HK;Gt.useColor=BK});var Fj=T((Ft)=>{var{Argument:Bj}=SQ(),{Command:UK}=Wj(),{CommanderError:Ht,InvalidArgumentError:Hj}=b7(),{Help:Ut}=JK(),{Option:Uj}=QK();Ft.program=new UK;Ft.createCommand=($)=>new UK($);Ft.createOption=($,D)=>new Uj($,D);Ft.createArgument=($,D)=>new Bj($,D);Ft.Command=UK;Ft.Option=Uj;Ft.Argument=Bj;Ft.Help=Ut;Ft.CommanderError=Ht;Ft.InvalidArgumentError=Hj;Ft.InvalidOptionArgumentError=Hj});var GD;var h9=c(()=>{GD={name:"@capgo/cli",type:"module",version:"7.81.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});var KK=T((ZI0,FK)=>{var vQ=process||{},qj=vQ.argv||[],CQ=vQ.env||{},jt=!(!!CQ.NO_COLOR||qj.includes("--no-color"))&&(!!CQ.FORCE_COLOR||qj.includes("--color")||vQ.platform==="win32"||(vQ.stdout||{}).isTTY&&CQ.TERM!=="dumb"||!!CQ.CI),Et=($,D,X=$)=>(J)=>{let Y=""+J,Q=Y.indexOf(D,$.length);return~Q?$+It(Y,D,X,Q)+D:$+Y+D},It=($,D,X,J)=>{let Y="",Q=0;do Y+=$.substring(Q,J)+X,Q=J+D.length,J=$.indexOf(D,Q);while(~J);return Y+$.substring(Q)},Vj=($=jt)=>{let D=$?Et:()=>String;return{isColorSupported:$,reset:D("\x1B[0m","\x1B[0m"),bold:D("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:D("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:D("\x1B[3m","\x1B[23m"),underline:D("\x1B[4m","\x1B[24m"),inverse:D("\x1B[7m","\x1B[27m"),hidden:D("\x1B[8m","\x1B[28m"),strikethrough:D("\x1B[9m","\x1B[29m"),black:D("\x1B[30m","\x1B[39m"),red:D("\x1B[31m","\x1B[39m"),green:D("\x1B[32m","\x1B[39m"),yellow:D("\x1B[33m","\x1B[39m"),blue:D("\x1B[34m","\x1B[39m"),magenta:D("\x1B[35m","\x1B[39m"),cyan:D("\x1B[36m","\x1B[39m"),white:D("\x1B[37m","\x1B[39m"),gray:D("\x1B[90m","\x1B[39m"),bgBlack:D("\x1B[40m","\x1B[49m"),bgRed:D("\x1B[41m","\x1B[49m"),bgGreen:D("\x1B[42m","\x1B[49m"),bgYellow:D("\x1B[43m","\x1B[49m"),bgBlue:D("\x1B[44m","\x1B[49m"),bgMagenta:D("\x1B[45m","\x1B[49m"),bgCyan:D("\x1B[46m","\x1B[49m"),bgWhite:D("\x1B[47m","\x1B[49m"),blackBright:D("\x1B[90m","\x1B[39m"),redBright:D("\x1B[91m","\x1B[39m"),greenBright:D("\x1B[92m","\x1B[39m"),yellowBright:D("\x1B[93m","\x1B[39m"),blueBright:D("\x1B[94m","\x1B[39m"),magentaBright:D("\x1B[95m","\x1B[39m"),cyanBright:D("\x1B[96m","\x1B[39m"),whiteBright:D("\x1B[97m","\x1B[39m"),bgBlackBright:D("\x1B[100m","\x1B[49m"),bgRedBright:D("\x1B[101m","\x1B[49m"),bgGreenBright:D("\x1B[102m","\x1B[49m"),bgYellowBright:D("\x1B[103m","\x1B[49m"),bgBlueBright:D("\x1B[104m","\x1B[49m"),bgMagentaBright:D("\x1B[105m","\x1B[49m"),bgCyanBright:D("\x1B[106m","\x1B[49m"),bgWhiteBright:D("\x1B[107m","\x1B[49m")}};FK.exports=Vj();FK.exports.createColors=Vj});var VK=T((AI0,zj)=>{var qK={to($,D){if(!D)return`\x1B[${$+1}G`;return`\x1B[${D+1};${$+1}H`},move($,D){let X="";if($<0)X+=`\x1B[${-$}D`;else if($>0)X+=`\x1B[${$}C`;if(D<0)X+=`\x1B[${-D}A`;else if(D>0)X+=`\x1B[${D}B`;return X},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Tt={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},St={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let D="";for(let X=0;X<$;X++)D+=this.line+(X<$-1?qK.up():"");if($)D+=qK.left;return D}};zj.exports={cursor:qK,scroll:Tt,erase:St,beep:"\x07"}});import{stdout as MK,stdin as Mj}from"node:process";import*as A4 from"node:readline";import Pt from"node:readline";import{ReadStream as wj}from"node:tty";function m9($,D,X){if(!X.some((G)=>!G.disabled))return $;let J=$+D,Y=Math.max(X.length-1,0),Q=J<0?Y:J>Y?0:J;return X[Q].disabled?m9(Q,D<0?-1:1,X):Q}function OK($,D,X){return String($).normalize().replaceAll(`\r
|
|
28
28
|
`,`
|
|
29
29
|
`).split(`
|
|
30
30
|
`).map((J)=>mt(J,D,X)).join(`
|
|
@@ -646,7 +646,7 @@ The build will be processed and sent directly to app stores.
|
|
|
646
646
|
\uD83D\uDCCB PREREQUISITE: Save credentials first with:
|
|
647
647
|
\`npx @capgo/cli build credentials save --appId <app-id> --platform <ios|android>\`
|
|
648
648
|
|
|
649
|
-
Example: npx @capgo/cli@latest build request com.example.app --platform ios --path .`).action(Em).option("--path <path>","Path to the project directory to build (default: current directory)").option("--platform <platform>","Target platform: ios or android (required)").option("--build-mode <buildMode>","Build mode: debug or release (default: release)").option("--build-
|
|
649
|
+
Example: npx @capgo/cli@latest build request com.example.app --platform ios --path .`).action(Em).option("--path <path>","Path to the project directory to build (default: current directory)").option("--platform <platform>","Target platform: ios or android (required)").option("--build-mode <buildMode>","Build mode: debug or release (default: release)").option("--build-certificate-base64 <cert>","iOS: Base64-encoded .p12 certificate").option("--build-provision-profile-base64 <profile>","iOS: Base64-encoded provisioning profile").option("--build-provision-profile-base64-prod <profile>","iOS: Base64-encoded production provisioning profile").option("--p12-password <password>","iOS: Certificate password (optional if cert has no password)").option("--apple-id <email>","iOS: Apple ID email").option("--apple-app-specific-password <password>","iOS: App-specific password").option("--apple-key-id <id>","iOS: App Store Connect API Key ID").option("--apple-issuer-id <id>","iOS: App Store Connect Issuer ID").option("--apple-key-content <content>","iOS: Base64-encoded App Store Connect API key (.p8)").option("--apple-profile-name <name>","iOS: Provisioning profile name").option("--app-store-connect-team-id <id>","iOS: App Store Connect Team ID").option("--ios-scheme <scheme>","iOS: Xcode scheme to build (default: App)").option("--ios-target <target>","iOS: Xcode target for reading build settings (default: same as scheme)").option("--android-keystore-file <keystore>","Android: Base64-encoded keystore file").option("--keystore-key-alias <alias>","Android: Keystore key alias").option("--keystore-key-password <password>","Android: Keystore key password").option("--keystore-store-password <password>","Android: Keystore store password").option("--play-config-json <json>","Android: Base64-encoded Google Play service account JSON").option("--output-upload","Override output upload behavior for this build only (enable). Precedence: CLI > env > saved credentials").option("--no-output-upload","Override output upload behavior for this build only (disable). Precedence: CLI > env > saved credentials").option("--output-retention <duration>","Override output link TTL for this build only (1h to 7d). Examples: 1h, 6h, 2d. Precedence: CLI > env > saved credentials").option("--skip-build-number-bump","Skip automatic build number/version code incrementing. Uses whatever version is already in the project files.").option("--no-skip-build-number-bump","Override saved credentials to re-enable automatic build number incrementing for this build only.").option("-a, --apikey <apikey>",e.apikey).option("--supa-host <supaHost>",e.supaHost).option("--supa-anon <supaAnon>",e.supaAnon).option("--verbose",e.verbose);var DK=To.command("credentials").description(`Manage build credentials stored locally on your machine.
|
|
650
650
|
|
|
651
651
|
\uD83D\uDD12 SECURITY:
|
|
652
652
|
- Credentials saved to ~/.capgo-credentials/credentials.json (global) or .capgo-credentials.json (local)
|
package/dist/package.json
CHANGED
package/dist/src/sdk.js
CHANGED
|
@@ -127,7 +127,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
127
127
|
`)}),$.__defineSetter__("stack",function(X){return[X].concat($.stack).join(`
|
|
128
128
|
|
|
129
129
|
`)}),$}});var $x=T((qyD,Dx)=>{var c6=p("constants"),uYD=process.cwd,FY=null,vYD=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!FY)FY=uYD.call(process);return FY};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(wY=process.chdir,process.chdir=function(D){FY=null,wY.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,wY)}var wY;Dx.exports=_YD;function _YD(D){if(c6.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)X(D);if(D.chown=Q(D.chown),D.fchown=Q(D.fchown),D.lchown=Q(D.lchown),D.chmod=Y(D.chmod),D.fchmod=Y(D.fchmod),D.lchmod=Y(D.lchmod),D.chownSync=F(D.chownSync),D.fchownSync=F(D.fchownSync),D.lchownSync=F(D.lchownSync),D.chmodSync=J(D.chmodSync),D.fchmodSync=J(D.fchmodSync),D.lchmodSync=J(D.lchmodSync),D.stat=w(D.stat),D.fstat=w(D.fstat),D.lstat=w(D.lstat),D.statSync=Z(D.statSync),D.fstatSync=Z(D.fstatSync),D.lstatSync=Z(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(O,U,z){if(z)process.nextTick(z)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(O,U,z,q){if(q)process.nextTick(q)},D.lchownSync=function(){};if(vYD==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(O){function U(z,q,B){var K=Date.now(),M=0;O(z,q,function L(I){if(I&&(I.code==="EACCES"||I.code==="EPERM"||I.code==="EBUSY")&&Date.now()-K<60000){if(setTimeout(function(){D.stat(q,function(W,N){if(W&&W.code==="ENOENT")O(z,q,L);else B(I)})},M),M<100)M+=10;return}if(B)B(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(U,O);return U}(D.rename);D.read=typeof D.read!=="function"?D.read:function(O){function U(z,q,B,K,M,L){var I;if(L&&typeof L==="function"){var W=0;I=function(N,V,R){if(N&&N.code==="EAGAIN"&&W<10)return W++,O.call(D,z,q,B,K,M,I);L.apply(this,arguments)}}return O.call(D,z,q,B,K,M,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(U,O);return U}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(O){return function(U,z,q,B,K){var M=0;while(!0)try{return O.call(D,U,z,q,B,K)}catch(L){if(L.code==="EAGAIN"&&M<10){M++;continue}throw L}}}(D.readSync);function $(O){O.lchmod=function(U,z,q){O.open(U,c6.O_WRONLY|c6.O_SYMLINK,z,function(B,K){if(B){if(q)q(B);return}O.fchmod(K,z,function(M){O.close(K,function(L){if(q)q(M||L)})})})},O.lchmodSync=function(U,z){var q=O.openSync(U,c6.O_WRONLY|c6.O_SYMLINK,z),B=!0,K;try{K=O.fchmodSync(q,z),B=!1}finally{if(B)try{O.closeSync(q)}catch(M){}else O.closeSync(q)}return K}}function X(O){if(c6.hasOwnProperty("O_SYMLINK")&&O.futimes)O.lutimes=function(U,z,q,B){O.open(U,c6.O_SYMLINK,function(K,M){if(K){if(B)B(K);return}O.futimes(M,z,q,function(L){O.close(M,function(I){if(B)B(L||I)})})})},O.lutimesSync=function(U,z,q){var B=O.openSync(U,c6.O_SYMLINK),K,M=!0;try{K=O.futimesSync(B,z,q),M=!1}finally{if(M)try{O.closeSync(B)}catch(L){}else O.closeSync(B)}return K};else if(O.futimes)O.lutimes=function(U,z,q,B){if(B)process.nextTick(B)},O.lutimesSync=function(){}}function Y(O){if(!O)return O;return function(U,z,q){return O.call(D,U,z,function(B){if(G(B))B=null;if(q)q.apply(this,arguments)})}}function J(O){if(!O)return O;return function(U,z){try{return O.call(D,U,z)}catch(q){if(!G(q))throw q}}}function Q(O){if(!O)return O;return function(U,z,q,B){return O.call(D,U,z,q,function(K){if(G(K))K=null;if(B)B.apply(this,arguments)})}}function F(O){if(!O)return O;return function(U,z,q){try{return O.call(D,U,z,q)}catch(B){if(!G(B))throw B}}}function w(O){if(!O)return O;return function(U,z,q){if(typeof z==="function")q=z,z=null;function B(K,M){if(M){if(M.uid<0)M.uid+=4294967296;if(M.gid<0)M.gid+=4294967296}if(q)q.apply(this,arguments)}return z?O.call(D,U,z,B):O.call(D,U,B)}}function Z(O){if(!O)return O;return function(U,z){var q=z?O.call(D,U,z):O.call(D,U);if(q){if(q.uid<0)q.uid+=4294967296;if(q.gid<0)q.gid+=4294967296}return q}}function G(O){if(!O)return!0;if(O.code==="ENOSYS")return!0;var U=!process.getuid||process.getuid()!==0;if(U){if(O.code==="EINVAL"||O.code==="EPERM")return!0}return!1}}});var Yx=T((zyD,Jx)=>{var Xx=p("stream").Stream;Jx.exports=kYD;function kYD(D){return{ReadStream:$,WriteStream:X};function $(Y,J){if(!(this instanceof $))return new $(Y,J);Xx.call(this);var Q=this;this.path=Y,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,J=J||{};var F=Object.keys(J);for(var w=0,Z=F.length;w<Z;w++){var G=F[w];this[G]=J[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Q._read()});return}D.open(this.path,this.flags,this.mode,function(O,U){if(O){Q.emit("error",O),Q.readable=!1;return}Q.fd=U,Q.emit("open",U),Q._read()})}function X(Y,J){if(!(this instanceof X))return new X(Y,J);Xx.call(this),this.path=Y,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,J=J||{};var Q=Object.keys(J);for(var F=0,w=Q.length;F<w;F++){var Z=Q[F];this[Z]=J[Z]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var Fx=T((ByD,Qx)=>{Qx.exports=yYD;var fYD=Object.getPrototypeOf||function(D){return D.__proto__};function yYD(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:fYD(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(D,X))}),$}});var S0=T((KyD,qU)=>{var L0=p("fs"),bYD=$x(),gYD=Yx(),hYD=Fx(),ZY=p("util"),r0,OY;if(typeof Symbol==="function"&&typeof Symbol.for==="function")r0=Symbol.for("graceful-fs.queue"),OY=Symbol.for("graceful-fs.previous");else r0="___graceful-fs.queue",OY="___graceful-fs.previous";function mYD(){}function Zx(D,$){Object.defineProperty(D,r0,{get:function(){return $}})}var $8=mYD;if(ZY.debuglog)$8=ZY.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))$8=function(){var D=ZY.format.apply(ZY,arguments);D="GFS4: "+D.split(/\n/).join(`
|
|
130
|
-
GFS4: `),console.error(D)};if(!L0[r0]){if(GU=global[r0]||[],Zx(L0,GU),L0.close=function(D){function $(X,Y){return D.call(L0,X,function(J){if(!J)wx();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,OY,{value:D}),$}(L0.close),L0.closeSync=function(D){function $(X){D.apply(L0,arguments),wx()}return Object.defineProperty($,OY,{value:D}),$}(L0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){$8(L0[r0]),p("assert").equal(L0[r0].length,0)})}var GU;if(!global[r0])Zx(global,L0[r0]);qU.exports=OU(hYD(L0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!L0.__patched)qU.exports=OU(L0),L0.__patched=!0;function OU(D){bYD(D),D.gracefulify=OU,D.createReadStream=V,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,v,S){if(typeof v==="function")S=v,v=null;return h(_,v,S);function h(g,l,f,j){return $(g,l,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))u9([h,[g,l,f],x,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var Y=D.writeFile;D.writeFile=J;function J(_,v,S,h){if(typeof S==="function")h=S,S=null;return g(_,v,S,h);function g(l,f,j,x,u){return Y(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=F;function F(_,v,S,h){if(typeof S==="function")h=S,S=null;return g(_,v,S,h);function g(l,f,j,x,u){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var w=D.copyFile;if(w)D.copyFile=Z;function Z(_,v,S,h){if(typeof S==="function")h=S,S=0;return g(_,v,S,h);function g(l,f,j,x,u){return w(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var G=D.readdir;D.readdir=U;var O=/^v[0-5]\./;function U(_,v,S){if(typeof v==="function")S=v,v=null;var h=O.test(process.version)?function(f,j,x,u){return G(f,g(f,j,x,u))}:function(f,j,x,u){return G(f,j,g(f,j,x,u))};return h(_,v,S);function g(l,f,j,x){return function(u,y){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))u9([h,[l,f,j],u,x||Date.now(),Date.now()]);else{if(y&&y.sort)y.sort();if(typeof j==="function")j.call(this,u,y)}}}}if(process.version.substr(0,4)==="v0.8"){var z=gYD(D);L=z.ReadStream,W=z.WriteStream}var q=D.ReadStream;if(q)L.prototype=Object.create(q.prototype),L.prototype.open=I;var B=D.WriteStream;if(B)W.prototype=Object.create(B.prototype),W.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var K=L;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var M=W;Object.defineProperty(D,"FileWriteStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0});function L(_,v){if(this instanceof L)return q.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v){if(_.autoClose)_.destroy();_.emit("error",v)}else _.fd=S,_.emit("open",S),_.read()})}function W(_,v){if(this instanceof W)return B.apply(this,arguments),this;else return W.apply(Object.create(W.prototype),arguments)}function N(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v)_.destroy(),_.emit("error",v);else _.fd=S,_.emit("open",S)})}function V(_,v){return new D.ReadStream(_,v)}function R(_,v){return new D.WriteStream(_,v)}var P=D.open;D.open=A;function A(_,v,S,h){if(typeof S==="function")h=S,S=null;return g(_,v,S,h);function g(l,f,j,x,u){return P(l,f,j,function(y,d){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}return D}function u9(D){$8("ENQUEUE",D[0].name,D[1]),L0[r0].push(D),UU()}var GY;function wx(){var D=Date.now();for(var $=0;$<L0[r0].length;++$)if(L0[r0][$].length>2)L0[r0][$][3]=D,L0[r0][$][4]=D;UU()}function UU(){if(clearTimeout(GY),GY=void 0,L0[r0].length===0)return;var D=L0[r0].shift(),$=D[0],X=D[1],Y=D[2],J=D[3],Q=D[4];if(J===void 0)$8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-J>=60000){$8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,Y)}else{var w=Date.now()-Q,Z=Math.max(Q-J,1),G=Math.min(Z*1.2,100);if(w>=G)$8("RETRY",$.name,X),$.apply(null,X.concat([J]));else L0[r0].push(D)}if(GY===void 0)GY=setTimeout(UU,0)}});var Ox=T((WyD,Gx)=>{function e1(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}Gx.exports=e1;e1.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};e1.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};e1.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var Y=this,J=setTimeout(function(){if(Y._attempts++,Y._operationTimeoutCb){if(Y._timeout=setTimeout(function(){Y._operationTimeoutCb(Y._attempts)},Y._operationTimeout),Y._options.unref)Y._timeout.unref()}Y._fn(Y._attempts)},X);if(this._options.unref)J.unref();return!0};e1.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};e1.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};e1.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};e1.prototype.start=e1.prototype.try;e1.prototype.errors=function(){return this._errors};e1.prototype.attempts=function(){return this._attempts};e1.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var Y=0;Y<this._errors.length;Y++){var J=this._errors[Y],Q=J.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=J,X=F}return $}});var qx=T((cYD)=>{var dYD=Ox();cYD.operation=function(D){var $=cYD.timeouts(D);return new dYD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};cYD.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Y=[];for(var J=0;J<$.retries;J++)Y.push(this.createTimeout(J,$));if(D&&D.forever&&!Y.length)Y.push(this.createTimeout(J,$));return Y.sort(function(Q,F){return Q-F}),Y};cYD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,Y=Math.round(X*$.minTimeout*Math.pow($.factor,D));return Y=Math.min(Y,$.maxTimeout),Y};cYD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var Y in D)if(typeof D[Y]==="function")X.push(Y)}for(var J=0;J<X.length;J++){var Q=X[J],F=D[Q];D[Q]=function(Z){var G=cYD.operation($),O=Array.prototype.slice.call(arguments,1),U=O.pop();O.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();U.apply(this,arguments)}),G.attempt(function(){Z.apply(D,O)})}.bind(D,F),D[Q].options=$}}});var zx=T((VyD,UY)=>{UY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")UY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")UY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var BY=T((NyD,_9)=>{var K0=global.process,X8=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!X8(K0))_9.exports=function(){return function(){}};else{if(zU=p("assert"),J8=zx(),BU=/^win/i.test(K0.platform),v9=p("events"),typeof v9!=="function")v9=v9.EventEmitter;if(K0.__signal_exit_emitter__)h0=K0.__signal_exit_emitter__;else h0=K0.__signal_exit_emitter__=new v9,h0.count=0,h0.emitted={};if(!h0.infinite)h0.setMaxListeners(1/0),h0.infinite=!0;_9.exports=function(D,$){if(!X8(global.process))return function(){};if(zU.equal(typeof D,"function","a callback must be provided for exit handler"),Y8===!1)qY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(h0.removeListener(X,D),h0.listeners("exit").length===0&&h0.listeners("afterexit").length===0)F3()};return h0.on(X,D),Y},F3=function(){if(!Y8||!X8(global.process))return;Y8=!1,J8.forEach(function($){try{K0.removeListener($,w3[$])}catch(X){}}),K0.emit=Z3,K0.reallyExit=zY,h0.count-=1},_9.exports.unload=F3,l6=function($,X,Y){if(h0.emitted[$])return;h0.emitted[$]=!0,h0.emit($,X,Y)},w3={},J8.forEach(function(D){w3[D]=function(){if(!X8(global.process))return;var X=K0.listeners(D);if(X.length===h0.count){if(F3(),l6("exit",null,D),l6("afterexit",null,D),BU&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),_9.exports.signals=function(){return J8},Y8=!1,qY=function(){if(Y8||!X8(global.process))return;Y8=!0,h0.count+=1,J8=J8.filter(function($){try{return K0.on($,w3[$]),!0}catch(X){return!1}}),K0.emit=WU,K0.reallyExit=KU},_9.exports.load=qY,zY=K0.reallyExit,KU=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),zY.call(K0,K0.exitCode)},Z3=K0.emit,WU=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=Z3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),Y}else return Z3.apply(this,arguments)}}var zU,J8,BU,v9,h0,F3,l6,w3,Y8,qY,zY,KU,Z3,WU});var Kx=T((oYD,HU)=>{var Bx=Symbol();function pYD(D,$,X){let Y=$[Bx];if(Y)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,Y)});let J=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,J,J,(Q)=>{if(Q)return X(Q);$.stat(D,(F,w)=>{if(F)return X(F);let Z=w.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,Bx,{value:Z}),X(null,w.mtime,Z)})})}function rYD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}oYD.probe=pYD;oYD.getMtime=rYD});var Mx=T((YQD,O3)=>{var sYD=p("path"),MU=S0(),eYD=qx(),DQD=BY(),Wx=Kx(),Q6={};function G3(D,$){return $.lockfilePath||`${D}.lock`}function LU(D,$,X){if(!$.realpath)return X(null,sYD.resolve(D));$.fs.realpath(D,X)}function NU(D,$,X){let Y=G3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return Wx.probe(Y,$.fs,(Q,F,w)=>{if(Q)return $.fs.rmdir(Y,()=>{}),X(Q);X(null,F,w)});if(J.code!=="EEXIST")return X(J);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Y,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return NU(D,{...$,stale:0},X);return X(Q)}if(!Hx(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));Vx(D,$,(w)=>{if(w)return X(w);NU(D,{...$,stale:0},X)})})})}function Hx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function Vx(D,$,X){$.fs.rmdir(G3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function KY(D,$){let X=Q6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(Y,J)=>{let Q=X.lastUpdate+$.stale<Date.now();if(Y){if(Y.code==="ENOENT"||Q)return VU(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,KY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return VU(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let w=Wx.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,w,w,(Z)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||G)return VU(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,KY(D,$)}X.mtime=w,X.lastUpdate=Date.now(),X.updateDelay=null,KY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function VU(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(Q6[D]===$)delete Q6[D];$.options.onCompromised(X)}function $QD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:MU,onCompromised:(Y)=>{throw Y},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),LU(D,$,(Y,J)=>{if(Y)return X(Y);let Q=eYD.operation($.retries);Q.attempt(()=>{NU(J,$,(F,w,Z)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Q6[J]={lockfilePath:G3(J,$),mtime:w,mtimePrecision:Z,options:$,lastUpdate:Date.now()};KY(J,$),X(null,(O)=>{if(G.released)return O&&O(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));Nx(J,{...$,realpath:!1},O)})})})})}function Nx(D,$,X){$={fs:MU,realpath:!0,...$},LU(D,$,(Y,J)=>{if(Y)return X(Y);let Q=Q6[J];if(!Q)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete Q6[J],Vx(J,$,X)})}function XQD(D,$,X){$={stale:1e4,realpath:!0,fs:MU,...$},$.stale=Math.max($.stale||0,2000),LU(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(G3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!Hx(F,$))})})}function JQD(){return Q6}DQD(()=>{for(let D in Q6){let $=Q6[D].options;try{$.fs.rmdirSync(G3(D,$))}catch(X){}}});YQD.lock=$QD;YQD.unlock=Nx;YQD.check=XQD;YQD.getLocks=JQD});var Ix=T((MyD,Lx)=>{var GQD=S0();function OQD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((Y)=>{X[Y]=(...J)=>{let Q=J.pop(),F;try{F=D[`${Y}Sync`](...J)}catch(w){return Q(w)}Q(null,F)}}),X}function UQD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function qQD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}function zQD(D){if(D={...D},D.fs=OQD(D.fs||GQD),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}Lx.exports={toPromise:UQD,toSync:qQD,toSyncOptions:zQD}});var Rx=T((LyD,n6)=>{var k9=Mx(),{toPromise:WY,toSync:HY,toSyncOptions:IU}=Ix();async function Ax(D,$){let X=await WY(k9.lock)(D,$);return WY(X)}function BQD(D,$){let X=HY(k9.lock)(D,IU($));return HY(X)}function KQD(D,$){return WY(k9.unlock)(D,$)}function WQD(D,$){return HY(k9.unlock)(D,IU($))}function HQD(D,$){return WY(k9.check)(D,$)}function VQD(D,$){return HY(k9.check)(D,IU($))}n6.exports=Ax;n6.exports.lock=Ax;n6.exports.unlock=KQD;n6.exports.lockSync=BQD;n6.exports.unlockSync=WQD;n6.exports.check=HQD;n6.exports.checkSync=VQD});var Sx=T((Px)=>{Object.defineProperty(Px,"__esModule",{value:!0});Px.canStoreURLs=Px.FileUrlStorage=void 0;var jx=p("fs"),NQD=LQD(eP()),Ex=MQD(Rx());function Cx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(Cx=function(Y){return Y?X:$})(D)}function MQD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=Cx($);if(X&&X.has(D))return X.get(D);var Y={__proto__:null},J=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=J?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(Y,Q,F):Y[Q]=D[Q]}return Y.default=D,X&&X.set(D,Y),Y}function LQD(D){return D&&D.__esModule?D:{default:D}}function U3(D){return U3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},U3(D)}function IQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function Tx(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,RQD(Y.key),Y)}}function AQD(D,$,X){if($)Tx(D.prototype,$);if(X)Tx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function RQD(D){var $=jQD(D,"string");return U3($)=="symbol"?$:$+""}function jQD(D,$){if(U3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(U3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var IyD=Px.canStoreURLs=!0,AyD=Px.FileUrlStorage=function(){function D($){IQD(this,D),this.path=$}return AQD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(Y,J){X._getItems("tus::",function(Q,F){if(Q)J(Q);else Y(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var Y=this;return new Promise(function(J,Q){Y._getItems("tus::".concat(X),function(F,w){if(F)Q(F);else J(w)})})}},{key:"removeUpload",value:function(X){var Y=this;return new Promise(function(J,Q){Y._removeItem(X,function(F){if(F)Q(F);else J()})})}},{key:"addUpload",value:function(X,Y){var J=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(w,Z){J._setItem(F,Y,function(G){if(G)Z(G);else w(F)})})}},{key:"_setItem",value:function(X,Y,J){var Q=this;Ex.lock(this.path,this._lockfileOptions()).then(function(F){J=Q._releaseAndCb(F,J),Q._getData(function(w,Z){if(w){J(w);return}Z[X]=Y,Q._writeData(Z,function(G){return J(G)})})}).catch(J)}},{key:"_getItems",value:function(X,Y){this._getData(function(J,Q){if(J){Y(J);return}var F=Object.keys(Q).filter(function(w){return w.startsWith(X)}).map(function(w){var Z=Q[w];return Z.urlStorageKey=w,Z});Y(null,F)})}},{key:"_removeItem",value:function(X,Y){var J=this;Ex.lock(this.path,this._lockfileOptions()).then(function(Q){Y=J._releaseAndCb(Q,Y),J._getData(function(F,w){if(F){Y(F);return}delete w[X],J._writeData(w,function(Z){return Y(Z)})})}).catch(Y)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,Y){return function(J){if(J){X().then(function(){return Y(J)}).catch(function(Q){return Y((0,NQD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,jx.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,jx.readFile)(this.path,"utf8",function(Y,J){if(Y){if(Y.code==="ENOENT")X(null,{});else X(Y);return}try{J=!J.trim().length?{}:JSON.parse(J)}catch(Q){X(Q);return}X(null,J)})}}])}()});var NY=T((i6)=>{Object.defineProperty(i6,"__esModule",{value:!0});Object.defineProperty(i6,"DefaultHttpStack",{enumerable:!0,get:function(){return kx.default}});Object.defineProperty(i6,"DetailedError",{enumerable:!0,get:function(){return TQD.default}});Object.defineProperty(i6,"FileUrlStorage",{enumerable:!0,get:function(){return fx.FileUrlStorage}});Object.defineProperty(i6,"StreamSource",{enumerable:!0,get:function(){return uQD.default}});i6.Upload=void 0;Object.defineProperty(i6,"canStoreURLs",{enumerable:!0,get:function(){return fx.canStoreURLs}});i6.defaultOptions=void 0;Object.defineProperty(i6,"enableDebugLog",{enumerable:!0,get:function(){return CQD.enableDebugLog}});i6.isSupported=void 0;var TQD=Q8(IO()),CQD=AO(),PQD=Q8(RT()),AU=Q8(JC()),xQD=Q8(AC()),SQD=Q8(CC()),kx=Q8(lC()),uQD=Q8(_O()),fx=Sx();function Q8(D){return D&&D.__esModule?D:{default:D}}function y9(D){return y9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},y9(D)}function vQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function ux(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,bx(Y.key),Y)}}function _QD(D,$,X){if($)ux(D.prototype,$);if(X)ux(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function kQD(D,$,X){return $=VY($),fQD(D,yx()?Reflect.construct($,X||[],VY(D).constructor):$.apply(D,X))}function fQD(D,$){if($&&(y9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return yQD(D)}function yQD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function yx(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(yx=function(){return!!D})()}function VY(D){return VY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},VY(D)}function bQD(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)RU(D,$)}function RU(D,$){return RU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},RU(D,$)}function vx(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function f9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?vx(Object(X),!0).forEach(function(Y){gQD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):vx(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}function gQD(D,$,X){if($=bx($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function bx(D){var $=hQD(D,"string");return y9($)=="symbol"?$:$+""}function hQD(D,$){if(y9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(y9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var _x=i6.defaultOptions=f9(f9({},AU.default.defaultOptions),{},{httpStack:new kx.default,fileReader:new xQD.default,urlStorage:new PQD.default,fingerprint:SQD.default}),jyD=i6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return vQD(this,$),Y=f9(f9({},_x),Y),kQD(this,$,[X,Y])}return bQD($,D),_QD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=f9(f9({},_x),J),AU.default.terminate(Y,J)}}])}(AU.default),EyD=i6.isSupported=!0});var F6;var MY=o(()=>{F6={name:"@capgo/cli",type:"module",version:"7.81.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});async function LY(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function F0(){let D=await LY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==F6.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${F6.version} it's not the latest version.
|
|
130
|
+
GFS4: `),console.error(D)};if(!L0[r0]){if(GU=global[r0]||[],Zx(L0,GU),L0.close=function(D){function $(X,Y){return D.call(L0,X,function(J){if(!J)wx();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,OY,{value:D}),$}(L0.close),L0.closeSync=function(D){function $(X){D.apply(L0,arguments),wx()}return Object.defineProperty($,OY,{value:D}),$}(L0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){$8(L0[r0]),p("assert").equal(L0[r0].length,0)})}var GU;if(!global[r0])Zx(global,L0[r0]);qU.exports=OU(hYD(L0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!L0.__patched)qU.exports=OU(L0),L0.__patched=!0;function OU(D){bYD(D),D.gracefulify=OU,D.createReadStream=V,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,v,S){if(typeof v==="function")S=v,v=null;return h(_,v,S);function h(g,l,f,j){return $(g,l,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))u9([h,[g,l,f],x,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var Y=D.writeFile;D.writeFile=J;function J(_,v,S,h){if(typeof S==="function")h=S,S=null;return g(_,v,S,h);function g(l,f,j,x,u){return Y(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=F;function F(_,v,S,h){if(typeof S==="function")h=S,S=null;return g(_,v,S,h);function g(l,f,j,x,u){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var w=D.copyFile;if(w)D.copyFile=Z;function Z(_,v,S,h){if(typeof S==="function")h=S,S=0;return g(_,v,S,h);function g(l,f,j,x,u){return w(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var G=D.readdir;D.readdir=U;var O=/^v[0-5]\./;function U(_,v,S){if(typeof v==="function")S=v,v=null;var h=O.test(process.version)?function(f,j,x,u){return G(f,g(f,j,x,u))}:function(f,j,x,u){return G(f,j,g(f,j,x,u))};return h(_,v,S);function g(l,f,j,x){return function(u,y){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))u9([h,[l,f,j],u,x||Date.now(),Date.now()]);else{if(y&&y.sort)y.sort();if(typeof j==="function")j.call(this,u,y)}}}}if(process.version.substr(0,4)==="v0.8"){var z=gYD(D);L=z.ReadStream,W=z.WriteStream}var q=D.ReadStream;if(q)L.prototype=Object.create(q.prototype),L.prototype.open=I;var B=D.WriteStream;if(B)W.prototype=Object.create(B.prototype),W.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var K=L;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var M=W;Object.defineProperty(D,"FileWriteStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0});function L(_,v){if(this instanceof L)return q.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v){if(_.autoClose)_.destroy();_.emit("error",v)}else _.fd=S,_.emit("open",S),_.read()})}function W(_,v){if(this instanceof W)return B.apply(this,arguments),this;else return W.apply(Object.create(W.prototype),arguments)}function N(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v)_.destroy(),_.emit("error",v);else _.fd=S,_.emit("open",S)})}function V(_,v){return new D.ReadStream(_,v)}function R(_,v){return new D.WriteStream(_,v)}var P=D.open;D.open=A;function A(_,v,S,h){if(typeof S==="function")h=S,S=null;return g(_,v,S,h);function g(l,f,j,x,u){return P(l,f,j,function(y,d){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}return D}function u9(D){$8("ENQUEUE",D[0].name,D[1]),L0[r0].push(D),UU()}var GY;function wx(){var D=Date.now();for(var $=0;$<L0[r0].length;++$)if(L0[r0][$].length>2)L0[r0][$][3]=D,L0[r0][$][4]=D;UU()}function UU(){if(clearTimeout(GY),GY=void 0,L0[r0].length===0)return;var D=L0[r0].shift(),$=D[0],X=D[1],Y=D[2],J=D[3],Q=D[4];if(J===void 0)$8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-J>=60000){$8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,Y)}else{var w=Date.now()-Q,Z=Math.max(Q-J,1),G=Math.min(Z*1.2,100);if(w>=G)$8("RETRY",$.name,X),$.apply(null,X.concat([J]));else L0[r0].push(D)}if(GY===void 0)GY=setTimeout(UU,0)}});var Ox=T((WyD,Gx)=>{function e1(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}Gx.exports=e1;e1.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};e1.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};e1.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var Y=this,J=setTimeout(function(){if(Y._attempts++,Y._operationTimeoutCb){if(Y._timeout=setTimeout(function(){Y._operationTimeoutCb(Y._attempts)},Y._operationTimeout),Y._options.unref)Y._timeout.unref()}Y._fn(Y._attempts)},X);if(this._options.unref)J.unref();return!0};e1.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};e1.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};e1.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};e1.prototype.start=e1.prototype.try;e1.prototype.errors=function(){return this._errors};e1.prototype.attempts=function(){return this._attempts};e1.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var Y=0;Y<this._errors.length;Y++){var J=this._errors[Y],Q=J.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=J,X=F}return $}});var qx=T((cYD)=>{var dYD=Ox();cYD.operation=function(D){var $=cYD.timeouts(D);return new dYD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};cYD.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Y=[];for(var J=0;J<$.retries;J++)Y.push(this.createTimeout(J,$));if(D&&D.forever&&!Y.length)Y.push(this.createTimeout(J,$));return Y.sort(function(Q,F){return Q-F}),Y};cYD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,Y=Math.round(X*$.minTimeout*Math.pow($.factor,D));return Y=Math.min(Y,$.maxTimeout),Y};cYD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var Y in D)if(typeof D[Y]==="function")X.push(Y)}for(var J=0;J<X.length;J++){var Q=X[J],F=D[Q];D[Q]=function(Z){var G=cYD.operation($),O=Array.prototype.slice.call(arguments,1),U=O.pop();O.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();U.apply(this,arguments)}),G.attempt(function(){Z.apply(D,O)})}.bind(D,F),D[Q].options=$}}});var zx=T((VyD,UY)=>{UY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")UY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")UY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var BY=T((NyD,_9)=>{var K0=global.process,X8=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!X8(K0))_9.exports=function(){return function(){}};else{if(zU=p("assert"),J8=zx(),BU=/^win/i.test(K0.platform),v9=p("events"),typeof v9!=="function")v9=v9.EventEmitter;if(K0.__signal_exit_emitter__)h0=K0.__signal_exit_emitter__;else h0=K0.__signal_exit_emitter__=new v9,h0.count=0,h0.emitted={};if(!h0.infinite)h0.setMaxListeners(1/0),h0.infinite=!0;_9.exports=function(D,$){if(!X8(global.process))return function(){};if(zU.equal(typeof D,"function","a callback must be provided for exit handler"),Y8===!1)qY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(h0.removeListener(X,D),h0.listeners("exit").length===0&&h0.listeners("afterexit").length===0)F3()};return h0.on(X,D),Y},F3=function(){if(!Y8||!X8(global.process))return;Y8=!1,J8.forEach(function($){try{K0.removeListener($,w3[$])}catch(X){}}),K0.emit=Z3,K0.reallyExit=zY,h0.count-=1},_9.exports.unload=F3,l6=function($,X,Y){if(h0.emitted[$])return;h0.emitted[$]=!0,h0.emit($,X,Y)},w3={},J8.forEach(function(D){w3[D]=function(){if(!X8(global.process))return;var X=K0.listeners(D);if(X.length===h0.count){if(F3(),l6("exit",null,D),l6("afterexit",null,D),BU&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),_9.exports.signals=function(){return J8},Y8=!1,qY=function(){if(Y8||!X8(global.process))return;Y8=!0,h0.count+=1,J8=J8.filter(function($){try{return K0.on($,w3[$]),!0}catch(X){return!1}}),K0.emit=WU,K0.reallyExit=KU},_9.exports.load=qY,zY=K0.reallyExit,KU=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),zY.call(K0,K0.exitCode)},Z3=K0.emit,WU=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=Z3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),Y}else return Z3.apply(this,arguments)}}var zU,J8,BU,v9,h0,F3,l6,w3,Y8,qY,zY,KU,Z3,WU});var Kx=T((oYD,HU)=>{var Bx=Symbol();function pYD(D,$,X){let Y=$[Bx];if(Y)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,Y)});let J=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,J,J,(Q)=>{if(Q)return X(Q);$.stat(D,(F,w)=>{if(F)return X(F);let Z=w.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,Bx,{value:Z}),X(null,w.mtime,Z)})})}function rYD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}oYD.probe=pYD;oYD.getMtime=rYD});var Mx=T((YQD,O3)=>{var sYD=p("path"),MU=S0(),eYD=qx(),DQD=BY(),Wx=Kx(),Q6={};function G3(D,$){return $.lockfilePath||`${D}.lock`}function LU(D,$,X){if(!$.realpath)return X(null,sYD.resolve(D));$.fs.realpath(D,X)}function NU(D,$,X){let Y=G3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return Wx.probe(Y,$.fs,(Q,F,w)=>{if(Q)return $.fs.rmdir(Y,()=>{}),X(Q);X(null,F,w)});if(J.code!=="EEXIST")return X(J);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Y,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return NU(D,{...$,stale:0},X);return X(Q)}if(!Hx(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));Vx(D,$,(w)=>{if(w)return X(w);NU(D,{...$,stale:0},X)})})})}function Hx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function Vx(D,$,X){$.fs.rmdir(G3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function KY(D,$){let X=Q6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(Y,J)=>{let Q=X.lastUpdate+$.stale<Date.now();if(Y){if(Y.code==="ENOENT"||Q)return VU(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,KY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return VU(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let w=Wx.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,w,w,(Z)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||G)return VU(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,KY(D,$)}X.mtime=w,X.lastUpdate=Date.now(),X.updateDelay=null,KY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function VU(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(Q6[D]===$)delete Q6[D];$.options.onCompromised(X)}function $QD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:MU,onCompromised:(Y)=>{throw Y},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),LU(D,$,(Y,J)=>{if(Y)return X(Y);let Q=eYD.operation($.retries);Q.attempt(()=>{NU(J,$,(F,w,Z)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Q6[J]={lockfilePath:G3(J,$),mtime:w,mtimePrecision:Z,options:$,lastUpdate:Date.now()};KY(J,$),X(null,(O)=>{if(G.released)return O&&O(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));Nx(J,{...$,realpath:!1},O)})})})})}function Nx(D,$,X){$={fs:MU,realpath:!0,...$},LU(D,$,(Y,J)=>{if(Y)return X(Y);let Q=Q6[J];if(!Q)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete Q6[J],Vx(J,$,X)})}function XQD(D,$,X){$={stale:1e4,realpath:!0,fs:MU,...$},$.stale=Math.max($.stale||0,2000),LU(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(G3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!Hx(F,$))})})}function JQD(){return Q6}DQD(()=>{for(let D in Q6){let $=Q6[D].options;try{$.fs.rmdirSync(G3(D,$))}catch(X){}}});YQD.lock=$QD;YQD.unlock=Nx;YQD.check=XQD;YQD.getLocks=JQD});var Ix=T((MyD,Lx)=>{var GQD=S0();function OQD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((Y)=>{X[Y]=(...J)=>{let Q=J.pop(),F;try{F=D[`${Y}Sync`](...J)}catch(w){return Q(w)}Q(null,F)}}),X}function UQD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function qQD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}function zQD(D){if(D={...D},D.fs=OQD(D.fs||GQD),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}Lx.exports={toPromise:UQD,toSync:qQD,toSyncOptions:zQD}});var Rx=T((LyD,n6)=>{var k9=Mx(),{toPromise:WY,toSync:HY,toSyncOptions:IU}=Ix();async function Ax(D,$){let X=await WY(k9.lock)(D,$);return WY(X)}function BQD(D,$){let X=HY(k9.lock)(D,IU($));return HY(X)}function KQD(D,$){return WY(k9.unlock)(D,$)}function WQD(D,$){return HY(k9.unlock)(D,IU($))}function HQD(D,$){return WY(k9.check)(D,$)}function VQD(D,$){return HY(k9.check)(D,IU($))}n6.exports=Ax;n6.exports.lock=Ax;n6.exports.unlock=KQD;n6.exports.lockSync=BQD;n6.exports.unlockSync=WQD;n6.exports.check=HQD;n6.exports.checkSync=VQD});var Sx=T((Px)=>{Object.defineProperty(Px,"__esModule",{value:!0});Px.canStoreURLs=Px.FileUrlStorage=void 0;var jx=p("fs"),NQD=LQD(eP()),Ex=MQD(Rx());function Cx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(Cx=function(Y){return Y?X:$})(D)}function MQD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=Cx($);if(X&&X.has(D))return X.get(D);var Y={__proto__:null},J=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=J?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(Y,Q,F):Y[Q]=D[Q]}return Y.default=D,X&&X.set(D,Y),Y}function LQD(D){return D&&D.__esModule?D:{default:D}}function U3(D){return U3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},U3(D)}function IQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function Tx(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,RQD(Y.key),Y)}}function AQD(D,$,X){if($)Tx(D.prototype,$);if(X)Tx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function RQD(D){var $=jQD(D,"string");return U3($)=="symbol"?$:$+""}function jQD(D,$){if(U3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(U3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var IyD=Px.canStoreURLs=!0,AyD=Px.FileUrlStorage=function(){function D($){IQD(this,D),this.path=$}return AQD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(Y,J){X._getItems("tus::",function(Q,F){if(Q)J(Q);else Y(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var Y=this;return new Promise(function(J,Q){Y._getItems("tus::".concat(X),function(F,w){if(F)Q(F);else J(w)})})}},{key:"removeUpload",value:function(X){var Y=this;return new Promise(function(J,Q){Y._removeItem(X,function(F){if(F)Q(F);else J()})})}},{key:"addUpload",value:function(X,Y){var J=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(w,Z){J._setItem(F,Y,function(G){if(G)Z(G);else w(F)})})}},{key:"_setItem",value:function(X,Y,J){var Q=this;Ex.lock(this.path,this._lockfileOptions()).then(function(F){J=Q._releaseAndCb(F,J),Q._getData(function(w,Z){if(w){J(w);return}Z[X]=Y,Q._writeData(Z,function(G){return J(G)})})}).catch(J)}},{key:"_getItems",value:function(X,Y){this._getData(function(J,Q){if(J){Y(J);return}var F=Object.keys(Q).filter(function(w){return w.startsWith(X)}).map(function(w){var Z=Q[w];return Z.urlStorageKey=w,Z});Y(null,F)})}},{key:"_removeItem",value:function(X,Y){var J=this;Ex.lock(this.path,this._lockfileOptions()).then(function(Q){Y=J._releaseAndCb(Q,Y),J._getData(function(F,w){if(F){Y(F);return}delete w[X],J._writeData(w,function(Z){return Y(Z)})})}).catch(Y)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,Y){return function(J){if(J){X().then(function(){return Y(J)}).catch(function(Q){return Y((0,NQD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,jx.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,jx.readFile)(this.path,"utf8",function(Y,J){if(Y){if(Y.code==="ENOENT")X(null,{});else X(Y);return}try{J=!J.trim().length?{}:JSON.parse(J)}catch(Q){X(Q);return}X(null,J)})}}])}()});var NY=T((i6)=>{Object.defineProperty(i6,"__esModule",{value:!0});Object.defineProperty(i6,"DefaultHttpStack",{enumerable:!0,get:function(){return kx.default}});Object.defineProperty(i6,"DetailedError",{enumerable:!0,get:function(){return TQD.default}});Object.defineProperty(i6,"FileUrlStorage",{enumerable:!0,get:function(){return fx.FileUrlStorage}});Object.defineProperty(i6,"StreamSource",{enumerable:!0,get:function(){return uQD.default}});i6.Upload=void 0;Object.defineProperty(i6,"canStoreURLs",{enumerable:!0,get:function(){return fx.canStoreURLs}});i6.defaultOptions=void 0;Object.defineProperty(i6,"enableDebugLog",{enumerable:!0,get:function(){return CQD.enableDebugLog}});i6.isSupported=void 0;var TQD=Q8(IO()),CQD=AO(),PQD=Q8(RT()),AU=Q8(JC()),xQD=Q8(AC()),SQD=Q8(CC()),kx=Q8(lC()),uQD=Q8(_O()),fx=Sx();function Q8(D){return D&&D.__esModule?D:{default:D}}function y9(D){return y9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},y9(D)}function vQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function ux(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,bx(Y.key),Y)}}function _QD(D,$,X){if($)ux(D.prototype,$);if(X)ux(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function kQD(D,$,X){return $=VY($),fQD(D,yx()?Reflect.construct($,X||[],VY(D).constructor):$.apply(D,X))}function fQD(D,$){if($&&(y9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return yQD(D)}function yQD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function yx(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(yx=function(){return!!D})()}function VY(D){return VY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},VY(D)}function bQD(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)RU(D,$)}function RU(D,$){return RU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},RU(D,$)}function vx(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function f9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?vx(Object(X),!0).forEach(function(Y){gQD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):vx(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}function gQD(D,$,X){if($=bx($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function bx(D){var $=hQD(D,"string");return y9($)=="symbol"?$:$+""}function hQD(D,$){if(y9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(y9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var _x=i6.defaultOptions=f9(f9({},AU.default.defaultOptions),{},{httpStack:new kx.default,fileReader:new xQD.default,urlStorage:new PQD.default,fingerprint:SQD.default}),jyD=i6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return vQD(this,$),Y=f9(f9({},_x),Y),kQD(this,$,[X,Y])}return bQD($,D),_QD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=f9(f9({},_x),J),AU.default.terminate(Y,J)}}])}(AU.default),EyD=i6.isSupported=!0});var F6;var MY=o(()=>{F6={name:"@capgo/cli",type:"module",version:"7.81.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});async function LY(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function F0(){let D=await LY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==F6.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${F6.version} it's not the latest version.
|
|
131
131
|
Please use @capgo/cli@${D}" or @capgo/cli@${$} to keep up to date with the latest features and bug fixes.`)}var q1=o(()=>{vD();MY()});async function dx(D,$,X,Y,J,Q="✅"){await RD(X,{channel:D,event:Y,icon:Q,user_id:$,...J?{tags:{"app-id":J}}:{},notify:!1})}var cx=o(()=>{vD();s$();q1();fD()});import{Buffer as lx}from"node:buffer";import{createHash as dQD}from"node:crypto";function lQD(D){let $=4294967295;for(let X=0;X<D.length;X++){let Y=D[X];$=cQD[($^Y)&255]^$>>>8}return $=$^4294967295,($>>>0).toString(16).padStart(8,"0")}async function p6(D,$="sha256"){let X=lx.isBuffer(D)?D:lx.from(D);if($==="crc32")return lQD(X);let Y=dQD($);return Y.update(X),Y.digest("hex")}var cQD;var q3=o(()=>{cQD=(()=>{let D=[];for(let $=0;$<256;$++){let X=$;for(let Y=0;Y<8;Y++)X=X&1?3988292384^X>>>1:X>>>1;D[$]=X}return D})()});var ix=T((dyD,nx)=>{var b9=1000,g9=b9*60,h9=g9*60,F8=h9*24,nQD=F8*7,iQD=F8*365.25;nx.exports=function(D,$){$=$||{};var X=typeof D;if(X==="string"&&D.length>0)return pQD(D);else if(X==="number"&&isFinite(D))return $.long?oQD(D):rQD(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function pQD(D){if(D=String(D),D.length>100)return;var $=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(D);if(!$)return;var X=parseFloat($[1]),Y=($[2]||"ms").toLowerCase();switch(Y){case"years":case"year":case"yrs":case"yr":case"y":return X*iQD;case"weeks":case"week":case"w":return X*nQD;case"days":case"day":case"d":return X*F8;case"hours":case"hour":case"hrs":case"hr":case"h":return X*h9;case"minutes":case"minute":case"mins":case"min":case"m":return X*g9;case"seconds":case"second":case"secs":case"sec":case"s":return X*b9;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function rQD(D){var $=Math.abs(D);if($>=F8)return Math.round(D/F8)+"d";if($>=h9)return Math.round(D/h9)+"h";if($>=g9)return Math.round(D/g9)+"m";if($>=b9)return Math.round(D/b9)+"s";return D+"ms"}function oQD(D){var $=Math.abs(D);if($>=F8)return IY(D,$,F8,"day");if($>=h9)return IY(D,$,h9,"hour");if($>=g9)return IY(D,$,g9,"minute");if($>=b9)return IY(D,$,b9,"second");return D+" ms"}function IY(D,$,X,Y){var J=$>=X*1.5;return Math.round(D/X)+" "+Y+(J?"s":"")}});var jU=T((cyD,px)=>{function aQD(D){X.debug=X,X.default=X,X.coerce=Z,X.disable=F,X.enable=J,X.enabled=w,X.humanize=ix(),X.destroy=G,Object.keys(D).forEach((O)=>{X[O]=D[O]}),X.names=[],X.skips=[],X.formatters={};function $(O){let U=0;for(let z=0;z<O.length;z++)U=(U<<5)-U+O.charCodeAt(z),U|=0;return X.colors[Math.abs(U)%X.colors.length]}X.selectColor=$;function X(O){let U,z=null,q,B;function K(...M){if(!K.enabled)return;let L=K,I=Number(new Date),W=I-(U||I);if(L.diff=W,L.prev=U,L.curr=I,U=I,M[0]=X.coerce(M[0]),typeof M[0]!=="string")M.unshift("%O");let N=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(R,P)=>{if(R==="%%")return"%";N++;let A=X.formatters[P];if(typeof A==="function"){let _=M[N];R=A.call(L,_),M.splice(N,1),N--}return R}),X.formatArgs.call(L,M),(L.log||X.log).apply(L,M)}if(K.namespace=O,K.useColors=X.useColors(),K.color=X.selectColor(O),K.extend=Y,K.destroy=X.destroy,Object.defineProperty(K,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(z!==null)return z;if(q!==X.namespaces)q=X.namespaces,B=X.enabled(O);return B},set:(M)=>{z=M}}),typeof X.init==="function")X.init(K);return K}function Y(O,U){let z=X(this.namespace+(typeof U>"u"?":":U)+O);return z.log=this.log,z}function J(O){X.save(O),X.namespaces=O,X.names=[],X.skips=[];let U=(typeof O==="string"?O:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let z of U)if(z[0]==="-")X.skips.push(z.slice(1));else X.names.push(z)}function Q(O,U){let z=0,q=0,B=-1,K=0;while(z<O.length)if(q<U.length&&(U[q]===O[z]||U[q]==="*"))if(U[q]==="*")B=q,K=z,q++;else z++,q++;else if(B!==-1)q=B+1,K++,z=K;else return!1;while(q<U.length&&U[q]==="*")q++;return q===U.length}function F(){let O=[...X.names,...X.skips.map((U)=>"-"+U)].join(",");return X.enable(""),O}function w(O){for(let U of X.skips)if(Q(O,U))return!1;for(let U of X.names)if(Q(O,U))return!0;return!1}function Z(O){if(O instanceof Error)return O.stack||O.message;return O}function G(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return X.enable(X.load()),X}px.exports=aQD});var ox=T((rx,AY)=>{rx.formatArgs=sQD;rx.save=eQD;rx.load=DFD;rx.useColors=tQD;rx.storage=$FD();rx.destroy=(()=>{let D=!1;return()=>{if(!D)D=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();rx.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function tQD(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let D;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(D=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(D[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function sQD(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+AY.exports.humanize(this.diff),!this.useColors)return;let $="color: "+this.color;D.splice(1,0,$,"color: inherit");let X=0,Y=0;D[0].replace(/%[a-zA-Z%]/g,(J)=>{if(J==="%%")return;if(X++,J==="%c")Y=X}),D.splice(Y,0,$)}rx.log=console.debug||console.log||(()=>{});function eQD(D){try{if(D)rx.storage.setItem("debug",D);else rx.storage.removeItem("debug")}catch($){}}function DFD(){let D;try{D=rx.storage.getItem("debug")||rx.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function $FD(){try{return localStorage}catch(D){}}AY.exports=jU()(rx);var{formatters:XFD}=AY.exports;XFD.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var tx=T((nyD,ax)=>{ax.exports=(D,$=process.argv)=>{let X=D.startsWith("-")?"":D.length===1?"-":"--",Y=$.indexOf(X+D),J=$.indexOf("--");return Y!==-1&&(J===-1||Y<J)}});var DS=T((iyD,ex)=>{var OFD=p("os"),sx=p("tty"),D$=tx(),{env:l0}=process,r6;if(D$("no-color")||D$("no-colors")||D$("color=false")||D$("color=never"))r6=0;else if(D$("color")||D$("colors")||D$("color=true")||D$("color=always"))r6=1;if("FORCE_COLOR"in l0)if(l0.FORCE_COLOR==="true")r6=1;else if(l0.FORCE_COLOR==="false")r6=0;else r6=l0.FORCE_COLOR.length===0?1:Math.min(parseInt(l0.FORCE_COLOR,10),3);function EU(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function TU(D,$){if(r6===0)return 0;if(D$("color=16m")||D$("color=full")||D$("color=truecolor"))return 3;if(D$("color=256"))return 2;if(D&&!$&&r6===void 0)return 0;let X=r6||0;if(l0.TERM==="dumb")return X;if(process.platform==="win32"){let Y=OFD.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in l0){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((Y)=>(Y in l0))||l0.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in l0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l0.TEAMCITY_VERSION)?1:0;if(l0.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in l0){let Y=parseInt((l0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(l0.TERM_PROGRAM){case"iTerm.app":return Y>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(l0.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(l0.TERM))return 1;if("COLORTERM"in l0)return 1;return X}function UFD(D){let $=TU(D,D&&D.isTTY);return EU($)}ex.exports={supportsColor:UFD,stdout:EU(TU(!0,sx.isatty(1))),stderr:EU(TU(!0,sx.isatty(2)))}});var YS=T((XS,jY)=>{var qFD=p("tty"),RY=p("util");XS.init=NFD;XS.log=WFD;XS.formatArgs=BFD;XS.save=HFD;XS.load=VFD;XS.useColors=zFD;XS.destroy=RY.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");XS.colors=[6,2,3,4,5,1];try{let D=DS();if(D&&(D.stderr||D).level>=2)XS.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(D){}XS.inspectOpts=Object.keys(process.env).filter((D)=>{return/^debug_/i.test(D)}).reduce((D,$)=>{let X=$.substring(6).toLowerCase().replace(/_([a-z])/g,(J,Q)=>{return Q.toUpperCase()}),Y=process.env[$];if(/^(yes|on|true|enabled)$/i.test(Y))Y=!0;else if(/^(no|off|false|disabled)$/i.test(Y))Y=!1;else if(Y==="null")Y=null;else Y=Number(Y);return D[X]=Y,D},{});function zFD(){return"colors"in XS.inspectOpts?Boolean(XS.inspectOpts.colors):qFD.isatty(process.stderr.fd)}function BFD(D){let{namespace:$,useColors:X}=this;if(X){let Y=this.color,J="\x1B[3"+(Y<8?Y:"8;5;"+Y),Q=` ${J};1m${$} \x1B[0m`;D[0]=Q+D[0].split(`
|
|
132
132
|
`).join(`
|
|
133
133
|
`+Q),D.push(J+"m+"+jY.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=KFD()+$+" "+D[0]}function KFD(){if(XS.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function WFD(...D){return process.stderr.write(RY.formatWithOptions(XS.inspectOpts,...D)+`
|