{"version":3,"sources":["../src/getUserState.ts"],"names":["getExpoHomeDirectory","home","process","env","__UNSAFE_EXPO_HOME_DIRECTORY","path","join","getUserStatePath","getUserState","JsonFile","jsonParseErrorDefault","cantReadFileDefault"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;AA6BA;AACA;AACO,SAASA,oBAAT,GAAgC;AACrC,QAAMC,IAAI,GAAG,oBAAb;;AAEA,MAAIC,OAAO,CAACC,GAAR,CAAYC,4BAAhB,EAA8C;AAC5C,WAAOF,OAAO,CAACC,GAAR,CAAYC,4BAAnB;AACD,GAFD,MAEO,IAAI,uBAAQ,cAAR,EAAwB,KAAxB,CAAJ,EAAoC;AACzC,WAAOC,IAAI,GAACC,IAAL,CAAUL,IAAV,EAAgB,eAAhB,CAAP;AACD,GAFM,MAEA,IAAI,uBAAQ,YAAR,EAAsB,KAAtB,CAAJ,EAAkC;AACvC,WAAOI,IAAI,GAACC,IAAL,CAAUL,IAAV,EAAgB,aAAhB,CAAP;AACD;;AACD,SAAOI,IAAI,GAACC,IAAL,CAAUL,IAAV,EAAgB,OAAhB,CAAP;AACD;;AAEM,SAASM,gBAAT,GAA4B;AACjC,SAAOF,IAAI,GAACC,IAAL,CAAUN,oBAAoB,EAA9B,EAAkC,YAAlC,CAAP;AACD;;AAEM,SAASQ,YAAT,GAAwB;AAC7B,SAAO,KAAIC,mBAAJ,EAA+BF,gBAAgB,EAA/C,EAAmD;AACxDG,IAAAA,qBAAqB,EAAE,EADiC;AAExD;AACAC,IAAAA,mBAAmB,EAAE;AAHmC,GAAnD,CAAP;AAKD","sourcesContent":["import JsonFile from '@expo/json-file';\nimport { boolish } from 'getenv';\nimport { homedir } from 'os';\nimport * as path from 'path';\n\nexport type UserSettingsData = {\n developmentCodeSigningId?: string;\n appleId?: string;\n accessToken?: string;\n auth?: UserData | null;\n ignoreBundledBinaries?: string[];\n openDevToolsAtStartup?: boolean;\n PATH?: string;\n sendTo?: string;\n uuid?: string;\n};\n\nexport type UserData = {\n appleId?: string;\n userId?: string;\n username?: string;\n currentConnection?: ConnectionType;\n sessionSecret?: string;\n};\n\nexport type ConnectionType =\n | 'Access-Token-Authentication'\n | 'Username-Password-Authentication'\n | 'facebook'\n | 'google-oauth2'\n | 'github';\n\n// The ~/.expo directory is used to store authentication sessions,\n// which are shared between EAS CLI and Expo CLI.\nexport function getExpoHomeDirectory() {\n const home = homedir();\n\n if (process.env.__UNSAFE_EXPO_HOME_DIRECTORY) {\n return process.env.__UNSAFE_EXPO_HOME_DIRECTORY;\n } else if (boolish('EXPO_STAGING', false)) {\n return path.join(home, '.expo-staging');\n } else if (boolish('EXPO_LOCAL', false)) {\n return path.join(home, '.expo-local');\n }\n return path.join(home, '.expo');\n}\n\nexport function getUserStatePath() {\n return path.join(getExpoHomeDirectory(), 'state.json');\n}\n\nexport function getUserState() {\n return new JsonFile(getUserStatePath(), {\n jsonParseErrorDefault: {},\n // This will ensure that an error isn't thrown if the file doesn't exist.\n cantReadFileDefault: {},\n });\n}\n"],"file":"getUserState.js"}