@evlop/commons 1.0.100 → 1.0.101
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/adapters/setUserToken/index.d.ts +2 -0
- package/dist/src/adapters/setUserToken/index.d.ts.map +1 -0
- package/dist/src/adapters/setUserToken/index.js +22 -0
- package/dist/src/adapters/setUserToken/index.js.map +1 -0
- package/dist/src/adapters/setUserToken/index.native.d.ts +2 -0
- package/dist/src/adapters/setUserToken/index.native.d.ts.map +1 -0
- package/dist/src/adapters/setUserToken/index.native.js +28 -0
- package/dist/src/adapters/setUserToken/index.native.js.map +1 -0
- package/dist/src/data-sources/scopeDataSource.d.ts.map +1 -1
- package/dist/src/data-sources/scopeDataSource.js +9 -1
- package/dist/src/data-sources/scopeDataSource.js.map +1 -1
- package/package.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/setUserToken/index.ts"],"names":[],"mappings":"AAAA,wBAA8B,YAAY,CAAC,KAAK,EAAE,MAAM,iBAKvD"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
function setUserToken(token) {
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
14
|
+
try {
|
15
|
+
localStorage.setItem('token', token);
|
16
|
+
}
|
17
|
+
catch (e) {
|
18
|
+
}
|
19
|
+
});
|
20
|
+
}
|
21
|
+
exports.default = setUserToken;
|
22
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapters/setUserToken/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAA8B,YAAY,CAAC,KAAa;;QACpD,IAAG;YACC,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SACxC;QAAC,OAAM,CAAC,EAAC;SACT;IACL,CAAC;CAAA;AALD,+BAKC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/adapters/setUserToken/index.native.ts"],"names":[],"mappings":"AAEA,wBAA8B,YAAY,CAAC,KAAK,EAAE,MAAM,gBAOvD"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const async_storage_1 = __importDefault(require("@react-native-async-storage/async-storage"));
|
16
|
+
function setUserToken(token) {
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
18
|
+
try {
|
19
|
+
yield async_storage_1.default.setItem('@User:token', token);
|
20
|
+
}
|
21
|
+
catch (e) {
|
22
|
+
console.log('Error setting token');
|
23
|
+
}
|
24
|
+
return null;
|
25
|
+
});
|
26
|
+
}
|
27
|
+
exports.default = setUserToken;
|
28
|
+
//# sourceMappingURL=index.native.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/adapters/setUserToken/index.native.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8FAAqE;AAErE,SAA8B,YAAY,CAAC,KAAa;;QACpD,IAAG;YACC,MAAM,uBAAY,CAAC,OAAO,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;SACpD;QAAC,OAAM,CAAC,EAAC;YACN,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;SACtC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CAAA;AAPD,+BAOC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scopeDataSource.d.ts","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,QAAA,MAAM,eAAe,EAAE,WAEtB,CAAC;
|
1
|
+
{"version":3,"file":"scopeDataSource.d.ts","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,QAAA,MAAM,eAAe,EAAE,WAEtB,CAAC;AAsBF,eAAe,eAAe,CAAC"}
|
@@ -8,7 +8,15 @@ const scopeDataSource = (options, { scope }) => {
|
|
8
8
|
};
|
9
9
|
scopeDataSource.keyExtractor = (options, { scope }) => {
|
10
10
|
const path = lodash_1.get(options, 'path', '');
|
11
|
-
|
11
|
+
const scopeValue = lodash_1.get(scope, lodash_1.get(options, 'path'));
|
12
|
+
return uuid_1.v5([
|
13
|
+
path,
|
14
|
+
JSON.stringify(scopeValue),
|
15
|
+
// to detect change in collection
|
16
|
+
lodash_1.get(scopeValue, 'page', ''),
|
17
|
+
lodash_1.get(scopeValue, 'isLoading', ''),
|
18
|
+
lodash_1.get(scopeValue, 'hasMore', ''),
|
19
|
+
].join(':'), constants_1.DATA_SOURCE_KEY_NAMESPACE);
|
12
20
|
};
|
13
21
|
scopeDataSource.displayName = 'Scope';
|
14
22
|
scopeDataSource.identifier = 'scope';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scopeDataSource.js","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":";;AAAA,mCAA6B;AAE7B,+BAAkC;AAClC,4CAAyD;AAGzD,MAAM,eAAe,GAAgB,CAAC,OAAO,EAAE,EAAC,KAAK,EAAC,EAAC,EAAE;IACjD,OAAO,YAAG,CAAC,KAAK,EAAC,YAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;AAC9C,CAAC,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,CAAC,OAAO,EAAE,EAAC,KAAK,EAAC,EAAC,EAAE;IAC/C,MAAM,IAAI,GAAG,YAAG,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACtC,
|
1
|
+
{"version":3,"file":"scopeDataSource.js","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":";;AAAA,mCAA6B;AAE7B,+BAAkC;AAClC,4CAAyD;AAGzD,MAAM,eAAe,GAAgB,CAAC,OAAO,EAAE,EAAC,KAAK,EAAC,EAAC,EAAE;IACjD,OAAO,YAAG,CAAC,KAAK,EAAC,YAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;AAC9C,CAAC,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,CAAC,OAAO,EAAE,EAAC,KAAK,EAAC,EAAC,EAAE;IAC/C,MAAM,IAAI,GAAG,YAAG,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE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