Remove React Native npm module

This commit is contained in:
Kyle Corbelli 2017-09-27 16:04:31 -07:00
parent f62a136ac2
commit 0d17743183
8 changed files with 491 additions and 2965 deletions

View File

@ -1,9 +1,5 @@
"use strict";
// import { AsyncStorage } from 'react-native'
Object.defineProperty(exports, "__esModule", { value: true });
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Rip this out into its own npm package:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var AsyncLocalStorage = {
getItem: function (key) { return new Promise(function (resolve, reject) {
try {
@ -72,7 +68,4 @@ var AsyncLocalStorage = {
}); },
};
exports.default = AsyncLocalStorage;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ^ Rip this out into its own npm package
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//# sourceMappingURL=AsyncLocalStorage.js.map

View File

@ -1 +1 @@
{"version":3,"file":"AsyncLocalStorage.js","sourceRoot":"","sources":["../src/AsyncLocalStorage.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAE9C,sIAAsI;AACtI,yCAAyC;AACzC,sIAAsI;AAEtI,IAAM,iBAAiB,GAAG;IACxB,OAAO,EAAE,UAAC,GAAW,IAAmB,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAClE,IAAI,CAAC;YACH,IAAM,KAAK,GAAkB,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC7D,OAAO,CAAC,KAAK,CAAC,CAAA;QAChB,CAAC;QAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAA;QACf,CAAC;IACH,CAAC,CAAC,EAPsC,CAOtC;IAEF,OAAO,EAAE,UAAC,GAAW,EAAE,KAAa,IAAK,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACnE,IAAI,CAAC;YACH,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAA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UAAA,YAAY,IAAI,OAAA,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAA7D,CAA6D,CAAC,CAAA;YACpG,IAAM,gBAAgB,GAAG,aAAa,CAAC,GAAG,CAAC,UAAA,YAAY,IAAI,OAAA,CAAE,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAE,EAAjE,CAAiE,CAAC,CAAA;YAC7H,OAAO,CAAC,gBAAgB,CAAC,CAAA;QAC3B,CAAC;QAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAA;QACf,CAAC;IACH,CAAC,CAAC,EARuC,CAQvC;CACH,CAAA;AAED,kBAAe,iBAAiB,CAAA"}

10
dist/actions.js vendored
View File

@ -39,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
var axios_1 = require("axios");
var types_1 = require("./types");
var AsyncLocalStorage_1 = require("./AsyncLocalStorage");
var auth_1 = require("./services/auth"); // <- maybe this is where you pass in the platform paramter, specifying if it is for a browser or for React Native
var auth_1 = require("./services/auth");
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Pure Redux actions:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -122,10 +122,9 @@ var generateAuthActions = function (config) {
case 2:
response = _a.sent();
auth_1.setAuthHeaders(response.headers);
// Have to check what type of platform it is, depending on the key provided by the end-user... like "browser", "iphone", or "android", etc.:
auth_1.persistAuthHeadersInDeviceStorage(Storage, response.headers);
userAttributesToSave = auth_1.getUserAttributesFromResponse(userAttributes, response);
dispatch(exports.registrationRequestSucceeded(userAttributesToSave)); // <- need to make this reducer more flexible
dispatch(exports.registrationRequestSucceeded(userAttributesToSave));
return [3 /*break*/, 4];
case 3:
error_1 = _a.sent();
@ -154,7 +153,6 @@ var generateAuthActions = function (config) {
case 2:
response = _a.sent();
auth_1.setAuthHeaders(response.headers);
// Have to check what type of platform it is, depending on the key provided by the end-user... like "browser", "iphone", or "android", etc.:
auth_1.persistAuthHeadersInDeviceStorage(Storage, response.headers);
userAttributesToSave = auth_1.getUserAttributesFromResponse(userAttributes, response);
dispatch(exports.verifyTokenRequestSucceeded(userAttributesToSave));
@ -190,7 +188,6 @@ var generateAuthActions = function (config) {
case 2:
response = _a.sent();
auth_1.setAuthHeaders(response.headers);
// Have to check what type of platform it is, depending on the key provided by the end-user... like "browser", "iphone", or "android", etc.:
auth_1.persistAuthHeadersInDeviceStorage(Storage, response.headers);
userAttributesToSave = auth_1.getUserAttributesFromResponse(userAttributes, response);
dispatch(exports.signInRequestSucceeded(userAttributesToSave));
@ -234,8 +231,7 @@ var generateAuthActions = function (config) {
case 5:
_c.sent();
auth_1.deleteAuthHeaders();
// Have to check what type of platform it is, depending on the key provided by the end-user... like "browser", "iphone", or "android", etc.:
auth_1.deleteAuthHeadersFromLocalStorage(Storage);
auth_1.deleteAuthHeadersFromDeviceStorage(Storage);
dispatch(exports.signOutRequestSucceeded());
return [3 /*break*/, 7];
case 6:

2
dist/actions.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -50,9 +50,7 @@ exports.setAuthHeaders = function (headers) {
axios_1.default.defaults.headers.common[key] = headers[key];
});
};
// Will have to take a parameter from the package user to determine if this is for a browser or for React Native:
exports.persistAuthHeadersInDeviceStorage = function (Storage, headers) {
// use multiSet:
authHeaderKeys.forEach(function (key) {
Storage.setItem(key, headers[key]);
});
@ -62,13 +60,10 @@ exports.deleteAuthHeaders = function () {
delete axios_1.default.defaults.headers.common[key];
});
};
// Will have to take a parameter from the package user to determine if this is for a browser or for React Native:
exports.deleteAuthHeadersFromLocalStorage = function (Storage) { return __awaiter(_this, void 0, void 0, function () {
exports.deleteAuthHeadersFromDeviceStorage = function (Storage) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
// can use multiRemove once you've written it:
authHeaderKeys.forEach(function (key) {
Storage.removeItem(key);
// localStorage.removeItem(key)
});
return [2 /*return*/];
});

View File

@ -1 +1 @@
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/services/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBA4DA;;AA5DA,+BAAyB;AACzB,qCAAkD;AAQlD,IAAM,cAAc,GAAkB;IACpC,cAAc;IACd,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,KAAK;CACN,CAAA;AAEY,QAAA,cAAc,GAAG,UAAC,OAAoB;IACjD,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,iHAAiH;AACpG,QAAA,iCAAiC,GAAG,UAAC,OAAsB,EAAE,OAAoB;IAC5F,gBAAgB;IAChB,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAEY,QAAA,iBAAiB,GAAG;IAC/B,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,OAAO,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,iHAAiH;AACpG,QAAA,iCAAiC,GAAG,UAAO,OAAsB;;QAC5E,8CAA8C;QAC9C,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;YACjC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YACvB,+BAA+B;QACjC,CAAC,CAAC,CAAA;;;KACH,CAAA;AAEY,Q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AAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAEY,QAAA,iBAAiB,GAAG;IAC/B,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,OAAO,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAEY,QAAA,kCAAkC,GAAG,UAAO,OAAsB;;QAC7E,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;YACjC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QACzB,CAAC,CAAC,CAAA;;;KACH,CAAA;AAEY,QAAA,6BAA6B,GAAG,UAC3C,cAAoC,EACpC,QAAsB;IAEtB,IAAM,sBAAsB,GAAyB,gCAAsB,CAAC,cAAc,CAAC,CAAA;IAC3F,IAAM,yBAAyB,GAAa,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;IAC/E,IAAM,sBAAsB,GAAyB,EAAE,CAAA;IACvD,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAC,GAAW;QAClD,EAAE,CAAC,CAAC,yBAAyB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAClD,sBAAsB,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC/E,CAAC;IACH,CAAC,CAAC,CAAA;IACF,MAAM,CAAC,sBAAsB,CAAA;AAC/B,CAAC,CAAA"}

3425
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,6 @@
"@types/react-redux": "^5.0.9",
"axios": "^0.16.2",
"react": "^15.6.1",
"react-native": "^0.48.4",
"react-redux": "^5.0.6",
"redux": "^3.7.2"
}