GT2/GT2-iOS/node_modules/xdl/build/__sourcemaps__/Api.js.map

1 line
16 KiB
Plaintext

{"version":3,"sources":["Api.js"],"names":["async","url","method","requestBody","requestOptions","clientId","await","Session","clientIdAsync","user","UserManager","getCurrentUserAsync","idToken","accessToken","skipValidationToken","process","env","let","headers","options","data","formData","isNode","convertedFormData","_convertFormDataToBuffer","getHeaders","response","axios","request","Error","responseBody","responseObj","_","isString","JSON","parse","e","ErrorCode","INVALID_JSON","err","ApiError","code","serverError","_callMethodAsync","Promise","resolve","pipe","concat","encoding","outputPath","progressFunction","retryFunction","promptShown","currentProgress","warningTimer","setTimeout","TIMER_DURATION","config","timeout","TIMEOUT","responseType","onDownloadProgress","progressEvent","roundedProgress","Math","floor","loaded","total","clearTimeout","fs","writeFile","Buffer","from","tmpPath","totalDownloadSize","downloadProgress","on","chunk","length","createWriteStream","rename","_downloadAsync","message","_isApiError","ROOT_BASE_URL","Config","api","scheme","host","port","API_BASE_URL","ApiClient","static","callMethodAsync","methodName","args","encodeURIComponent","stringify","callPathAsync","path","versionsAsync","_versionCache","getAsync","xdlSchemaAsync","sdkVersion","_schemaCaches","hasOwnProperty","join","__dirname","sdkVersionsAsync","versions","sdkVersions","downloadAsync","extract","dotExpoHomeDirectory","UserSettings","Extract","extractAsync","rimraf","sync"],"mappings":";;;;;;;;;+BAuCAA,WAAgCC,GAAhCD,EAAqCE,MAArCF,EAA6CG,WAA7CH,EAA0DI,cAA1DJ,EAAwF;AACtF,UAAMK,WAAWC,MAAMC,8BAAQC,aAARD,EAAvB;AACA,UAAME,OAAO,CAACH,MAAMI,gCAAYC,mBAAZD,EAAP,KAA6C,EAA1D;;AAEA,UAAM,EAAEE,OAAF,EAAWC,WAAX,KAA2BJ,IAAjC;AACA,UAAMK,sBAAsBC,QAAQC,GAARD,CAAY,qCAAZA,CAA5B;;AAEAE,QAAIC,UAAe;AACjB,sBAAgBb;AADC,KAAnBY;;AAIA,QAAIH,mBAAJ,EAAyB;AACvBI,cAAQ,o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\nimport fs from 'fs-extra';\nimport rimraf from 'rimraf';\nimport path from 'path';\nimport axios from 'axios';\nimport concat from 'concat-stream';\n\nimport { Cacher } from './tools/FsCache';\nimport Config from './Config';\nimport { isNode } from './tools/EnvironmentHelper';\nimport ErrorCode from './ErrorCode';\nimport * as Extract from './Extract';\nimport * as Session from './Session';\nimport UserManager from './User';\nimport UserSettings from './UserSettings';\nimport XDLError from './XDLError';\n\nconst TIMER_DURATION = 30000;\nconst TIMEOUT = 3600000;\n\nfunction ApiError(code, message) {\n let err = new Error(message);\n // $FlowFixMe error has no property code\n err.code = code;\n // $FlowFixMe error has no property _isApiError\n err._isApiError = true;\n return err;\n}\n\nlet ROOT_BASE_URL = `${Config.api.scheme}://${Config.api.host}`;\nif (Config.api.port) {\n ROOT_BASE_URL += ':' + Config.api.port;\n}\nlet API_BASE_URL = ROOT_BASE_URL + '/--/api/';\n\nasync function _callMethodAsync(url, method, requestBody, requestOptions): Promise<any> {\n const clientId = await Session.clientIdAsync();\n const user = (await UserManager.getCurrentUserAsync()) || {};\n\n const { idToken, accessToken } = user;\n const skipValidationToken = process.env['EXPO_SKIP_MANIFEST_VALIDATION_TOKEN'];\n\n let headers: any = {\n 'Exp-ClientId': clientId,\n };\n\n if (skipValidationToken) {\n headers['Exp-Skip-Manifest-Validation-Token'] = skipValidationToken;\n }\n\n if (idToken) {\n headers['Authorization'] = `Bearer ${idToken}`;\n }\n\n if (accessToken) {\n headers['Exp-Access-Token'] = accessToken;\n }\n\n let options = {\n url,\n method: method || 'get',\n headers,\n };\n\n if (requestBody) {\n options = {\n ...options,\n data: requestBody,\n };\n }\n\n if (requestOptions) {\n if (requestOptions.formData) {\n let data = requestOptions.formData;\n if (isNode()) {\n let convertedFormData = await _convertFormDataToBuffer(requestOptions.formData);\n data = convertedFormData.data;\n options.headers = {\n ...options.headers,\n ...requestOptions.formData.getHeaders(),\n };\n }\n options = { ...options, data };\n } else {\n options = { ...options, ...requestOptions };\n }\n }\n let response = await axios.request(options);\n if (!response) {\n throw new Error('Unexpected error: Request failed.');\n }\n let responseBody = response.data;\n var responseObj;\n if (_.isString(responseBody)) {\n try {\n responseObj = JSON.parse(responseBody);\n } catch (e) {\n throw new XDLError(\n ErrorCode.INVALID_JSON,\n 'Invalid JSON returned from API: ' + e + '. Response body: ' + responseBody\n );\n }\n } else {\n responseObj = responseBody;\n }\n if (responseObj.err) {\n let err = ApiError(responseObj.code || 'API_ERROR', 'API Response Error: ' + responseObj.err);\n // $FlowFixMe can't add arbitrary properties to error\n err.serverError = responseObj.err;\n throw err;\n } else {\n return responseObj;\n }\n}\n\nasync function _convertFormDataToBuffer(formData) {\n return new Promise(resolve => {\n formData.pipe(concat({ encoding: 'buffer' }, data => resolve({ data })));\n });\n}\n\nasync function _downloadAsync(url, outputPath, progressFunction, retryFunction) {\n let promptShown = false;\n let currentProgress = 0;\n\n let warningTimer = setTimeout(() => {\n if (retryFunction) {\n retryFunction();\n }\n promptShown = true;\n }, TIMER_DURATION);\n\n let config;\n // Checks if the call is being made in XDE or exp. (If XDE = XHR, if exp = HTTP);\n if (!isNode()) {\n config = {\n timeout: TIMEOUT,\n responseType: 'arraybuffer',\n onDownloadProgress: progressEvent => {\n const roundedProgress = Math.floor(progressEvent.loaded / progressEvent.total * 100);\n if (currentProgress !== roundedProgress) {\n currentProgress = roundedProgress;\n clearTimeout(warningTimer);\n if (!promptShown) {\n warningTimer = setTimeout(() => {\n if (retryFunction) {\n retryFunction();\n }\n promptShown = true;\n }, TIMER_DURATION);\n }\n }\n if (progressFunction) {\n progressFunction(roundedProgress);\n }\n },\n };\n let response = await axios(url, config);\n await fs.writeFile(outputPath, Buffer.from(response.data));\n clearTimeout(warningTimer);\n } else {\n const tmpPath = `${outputPath}.download`;\n config = {\n timeout: TIMEOUT,\n responseType: 'stream',\n };\n let response = await axios(url, config);\n await new Promise(resolve => {\n let totalDownloadSize = response.data.headers['content-length'];\n let downloadProgress = 0;\n response.data\n .on('data', chunk => {\n downloadProgress += chunk.length;\n const roundedProgress = Math.floor(downloadProgress / totalDownloadSize * 100);\n if (currentProgress !== roundedProgress) {\n currentProgress = roundedProgress;\n clearTimeout(warningTimer);\n if (!promptShown) {\n warningTimer = setTimeout(() => {\n if (retryFunction) {\n retryFunction();\n }\n promptShown = true;\n }, TIMER_DURATION);\n }\n if (progressFunction) {\n progressFunction(roundedProgress);\n }\n }\n })\n .on('end', () => {\n clearTimeout(warningTimer);\n if (progressFunction && currentProgress !== 100) {\n progressFunction(100);\n }\n resolve();\n })\n .pipe(fs.createWriteStream(tmpPath));\n });\n await fs.rename(tmpPath, outputPath);\n }\n}\n\nexport default class ApiClient {\n static host: string = Config.api.host;\n static port: number = Config.api.port || 80;\n\n static _versionCache = new Cacher(\n async () => {\n return await ApiClient.callPathAsync('/--/versions');\n },\n 'versions.json',\n 0,\n path.join(__dirname, '../caches/versions.json')\n );\n\n static _schemaCaches = {};\n\n static async callMethodAsync(\n methodName: string,\n args: Array<*>,\n method: string,\n requestBody: ?Object,\n requestOptions: ?Object = {}\n ): Promise<any> {\n let url =\n API_BASE_URL +\n encodeURIComponent(methodName) +\n '/' +\n encodeURIComponent(JSON.stringify(args));\n return _callMethodAsync(url, method, requestBody, requestOptions);\n }\n\n static async callPathAsync(\n path: string,\n method: string,\n requestBody: ?Object,\n requestOptions: ?Object = {}\n ) {\n let url = ROOT_BASE_URL + path;\n return _callMethodAsync(url, method, requestBody, requestOptions);\n }\n\n static async versionsAsync() {\n return await ApiClient._versionCache.getAsync();\n }\n\n static async xdlSchemaAsync(sdkVersion) {\n if (!ApiClient._schemaCaches.hasOwnProperty(sdkVersion)) {\n ApiClient._schemaCaches[sdkVersion] = new Cacher(\n async () => {\n return await ApiClient.callPathAsync(`/--/xdl-schema/${sdkVersion}`);\n },\n `schema-${sdkVersion}.json`,\n 0,\n path.join(__dirname, `../caches/schema-${sdkVersion}.json`)\n );\n }\n\n return await ApiClient._schemaCaches[sdkVersion].getAsync();\n }\n\n static async sdkVersionsAsync() {\n let versions = await ApiClient.versionsAsync();\n return versions.sdkVersions;\n }\n\n static async downloadAsync(url, outputPath, options = {}, progressFunction, retryFunction) {\n if (options.extract) {\n let dotExpoHomeDirectory = UserSettings.dotExpoHomeDirectory();\n let tmpPath = path.join(dotExpoHomeDirectory, 'tmp-download-file');\n await _downloadAsync(url, tmpPath);\n await Extract.extractAsync(tmpPath, outputPath);\n rimraf.sync(tmpPath);\n } else {\n await _downloadAsync(url, outputPath, progressFunction, retryFunction);\n }\n }\n}\n"],"sourceRoot":"/xdl/src"}