@mirai/core 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,6 +15,8 @@ const fetchSession = function () {
|
|
|
15
15
|
cache: CACHE_LIMIT
|
|
16
16
|
});
|
|
17
17
|
let session = storage.get(SESSION_STORAGE_ID);
|
|
18
|
+
|
|
19
|
+
//TODO: it`s possible that this never occurs. Remove when don`t exists legacy CLUB
|
|
18
20
|
if (!session) {
|
|
19
21
|
storage = new _dataSources.Storage({
|
|
20
22
|
adapter: _dataSources.SessionAdapter
|
|
@@ -32,34 +34,34 @@ const fetchSession = function () {
|
|
|
32
34
|
const {
|
|
33
35
|
accessToken,
|
|
34
36
|
authorization,
|
|
35
|
-
email,
|
|
36
|
-
firstName,
|
|
37
|
-
lastName,
|
|
38
|
-
country,
|
|
39
|
-
dateOfBirth,
|
|
40
37
|
club: {
|
|
41
|
-
name,
|
|
42
38
|
id,
|
|
43
|
-
|
|
39
|
+
name
|
|
44
40
|
} = {},
|
|
45
|
-
|
|
41
|
+
clubName,
|
|
42
|
+
clubLevel,
|
|
43
|
+
country,
|
|
44
|
+
dateOfBirth,
|
|
45
|
+
email,
|
|
46
|
+
firstName,
|
|
46
47
|
// ? Not sure we should get this data from legacy
|
|
47
48
|
idClub: clubId,
|
|
48
|
-
|
|
49
|
-
level
|
|
49
|
+
lastName,
|
|
50
|
+
level,
|
|
51
|
+
subscribed
|
|
50
52
|
} = session || {};
|
|
51
53
|
return accessToken || authorization ? {
|
|
52
54
|
authorization: authorization || accessToken,
|
|
53
|
-
email,
|
|
54
|
-
firstName,
|
|
55
|
-
lastName,
|
|
56
|
-
country,
|
|
57
|
-
dateOfBirth,
|
|
58
55
|
club: {
|
|
59
|
-
name: name || clubName,
|
|
60
56
|
id: id || clubId,
|
|
61
|
-
|
|
57
|
+
name: name || clubName
|
|
62
58
|
},
|
|
59
|
+
country,
|
|
60
|
+
dateOfBirth,
|
|
61
|
+
email,
|
|
62
|
+
firstName,
|
|
63
|
+
lastName,
|
|
64
|
+
level: level || clubLevel,
|
|
63
65
|
subscribed
|
|
64
66
|
} : undefined;
|
|
65
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchSession.js","names":["CACHE_LIMIT","SESSION_STORAGE_LEGACY_ID","SESSION_STORAGE_ID","fetchSession","urlParams","storage","Storage","adapter","LocalAdapter","cache","session","get","SessionAdapter","JSON","parse","error","console","accessToken","authorization","
|
|
1
|
+
{"version":3,"file":"fetchSession.js","names":["CACHE_LIMIT","SESSION_STORAGE_LEGACY_ID","SESSION_STORAGE_ID","fetchSession","urlParams","storage","Storage","adapter","LocalAdapter","cache","session","get","SessionAdapter","JSON","parse","error","console","accessToken","authorization","club","id","name","clubName","clubLevel","country","dateOfBirth","email","firstName","idClub","clubId","lastName","level","subscribed","undefined"],"sources":["../../src/helpers/fetchSession.js"],"sourcesContent":["import { LocalAdapter, SessionAdapter, Storage } from '@mirai/data-sources';\n\nconst CACHE_LIMIT = 1000 * 60 * 60 * 24 * 7;\nconst SESSION_STORAGE_LEGACY_ID = 'CLUB';\nconst SESSION_STORAGE_ID = 'MIRAI:SERVICE:USER:session';\n\nexport const fetchSession = (urlParams = {}) => {\n let storage = new Storage({ adapter: LocalAdapter, cache: CACHE_LIMIT });\n let session = storage.get(SESSION_STORAGE_ID);\n\n //TODO: it`s possible that this never occurs. Remove when don`t exists legacy CLUB\n if (!session) {\n storage = new Storage({ adapter: SessionAdapter });\n session = storage.get(SESSION_STORAGE_LEGACY_ID);\n }\n\n if (!session && urlParams.session) {\n try {\n session = JSON.parse(urlParams.session);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('', error);\n }\n }\n\n const {\n accessToken,\n authorization,\n club: { id, name } = {},\n clubName,\n clubLevel,\n country,\n dateOfBirth,\n email,\n firstName,\n // ? Not sure we should get this data from legacy\n idClub: clubId,\n lastName,\n level,\n subscribed,\n } = session || {};\n\n return accessToken || authorization\n ? {\n authorization: authorization || accessToken,\n club: { id: id || clubId, name: name || clubName },\n country,\n dateOfBirth,\n email,\n firstName,\n lastName,\n level: level || clubLevel,\n subscribed,\n }\n : undefined;\n};\n"],"mappings":";;;;;;AAAA;AAEA,MAAMA,WAAW,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAC3C,MAAMC,yBAAyB,GAAG,MAAM;AACxC,MAAMC,kBAAkB,GAAG,4BAA4B;AAEhD,MAAMC,YAAY,GAAG,YAAoB;EAAA,IAAnBC,SAAS,uEAAG,CAAC,CAAC;EACzC,IAAIC,OAAO,GAAG,IAAIC,oBAAO,CAAC;IAAEC,OAAO,EAAEC,yBAAY;IAAEC,KAAK,EAAET;EAAY,CAAC,CAAC;EACxE,IAAIU,OAAO,GAAGL,OAAO,CAACM,GAAG,CAACT,kBAAkB,CAAC;;EAE7C;EACA,IAAI,CAACQ,OAAO,EAAE;IACZL,OAAO,GAAG,IAAIC,oBAAO,CAAC;MAAEC,OAAO,EAAEK;IAAe,CAAC,CAAC;IAClDF,OAAO,GAAGL,OAAO,CAACM,GAAG,CAACV,yBAAyB,CAAC;EAClD;EAEA,IAAI,CAACS,OAAO,IAAIN,SAAS,CAACM,OAAO,EAAE;IACjC,IAAI;MACFA,OAAO,GAAGG,IAAI,CAACC,KAAK,CAACV,SAAS,CAACM,OAAO,CAAC;IACzC,CAAC,CAAC,OAAOK,KAAK,EAAE;MACd;MACAC,OAAO,CAACD,KAAK,CAAC,EAAE,EAAEA,KAAK,CAAC;IAC1B;EACF;EAEA,MAAM;IACJE,WAAW;IACXC,aAAa;IACbC,IAAI,EAAE;MAAEC,EAAE;MAAEC;IAAK,CAAC,GAAG,CAAC,CAAC;IACvBC,QAAQ;IACRC,SAAS;IACTC,OAAO;IACPC,WAAW;IACXC,KAAK;IACLC,SAAS;IACT;IACAC,MAAM,EAAEC,MAAM;IACdC,QAAQ;IACRC,KAAK;IACLC;EACF,CAAC,GAAGtB,OAAO,IAAI,CAAC,CAAC;EAEjB,OAAOO,WAAW,IAAIC,aAAa,GAC/B;IACEA,aAAa,EAAEA,aAAa,IAAID,WAAW;IAC3CE,IAAI,EAAE;MAAEC,EAAE,EAAEA,EAAE,IAAIS,MAAM;MAAER,IAAI,EAAEA,IAAI,IAAIC;IAAS,CAAC;IAClDE,OAAO;IACPC,WAAW;IACXC,KAAK;IACLC,SAAS;IACTG,QAAQ;IACRC,KAAK,EAAEA,KAAK,IAAIR,SAAS;IACzBS;EACF,CAAC,GACDC,SAAS;AACf,CAAC;AAAC"}
|
package/package.json
CHANGED
package/public/customer.css
CHANGED