UNPKG

react-native-gigya-sdk

Version:
44 lines (37 loc) 1.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _default; var _getState = _interopRequireDefault(require("./getState")); var _sendApiCall = _interopRequireDefault(require("./sendApiCall")); var _state = require("../internals/state"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _default(options) { return new Promise(async (resolve, reject) => { try { var _state$regToken; const state = await (0, _getState.default)(); const response = await (0, _sendApiCall.default)('accounts.getAccountInfo', { ...((options === null || options === void 0 ? void 0 : options.noUID) && { regToken: (options === null || options === void 0 ? void 0 : options.regToken) || ((_state$regToken = state.regToken) === null || _state$regToken === void 0 ? void 0 : _state$regToken.value) }), ...(!(options !== null && options !== void 0 && options.noUID) && { UID: (options === null || options === void 0 ? void 0 : options.UID) || state.UID }), ...((options === null || options === void 0 ? void 0 : options.include) && { include: options === null || options === void 0 ? void 0 : options.include }), ...((options === null || options === void 0 ? void 0 : options.extraProfileFields) && { extraProfileFields: options === null || options === void 0 ? void 0 : options.extraProfileFields }) }); await (0, _state.setState)({ UID: response.UID }); resolve(response); } catch (e) { reject(e); } }); } //# sourceMappingURL=getAccountInfo.js.map