apps-sdk 1.0.1 → 1.0.2
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.
- package/config.js +1 -1
- package/index.js +3 -2
- package/package.json +1 -1
- package/src/libraries/Session.js +3 -1
- package/src/libraries/index.js +1 -0
- package/types/index.d.ts +19 -0
package/config.js
CHANGED
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {NotificationsPush, Networking, Storage} from "./src/libraries";
|
|
1
|
+
import {NotificationsPush, Networking, Storage, Session} from "./src/libraries";
|
|
2
2
|
|
|
3
3
|
class WebappsSDK {
|
|
4
4
|
initializePushNotifications = async() => {
|
|
@@ -15,5 +15,6 @@ const Core = new WebappsSDK();
|
|
|
15
15
|
export default {
|
|
16
16
|
initializePushNotifications: Core.initializePushNotifications,
|
|
17
17
|
networking: Networking,
|
|
18
|
-
storage: Storage
|
|
18
|
+
storage: Storage,
|
|
19
|
+
session: Session
|
|
19
20
|
}
|
package/package.json
CHANGED
package/src/libraries/Session.js
CHANGED
|
@@ -6,7 +6,7 @@ import Storage from './Storage';
|
|
|
6
6
|
import Networking from './Networking';
|
|
7
7
|
import * as config from "../../config";
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class Session {
|
|
10
10
|
sessionData = {};
|
|
11
11
|
sessionID = null;
|
|
12
12
|
isFirstOpen = false;
|
|
@@ -102,3 +102,5 @@ class session {
|
|
|
102
102
|
this.isDevUser = isDevUser;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
+
|
|
106
|
+
export default new Session();
|
package/src/libraries/index.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -11,6 +11,25 @@ declare module 'apps-sdk' {
|
|
|
11
11
|
getData(key: string): Promise<any>;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
export class Session {
|
|
15
|
+
sessionData: any;
|
|
16
|
+
sessionID: string | null;
|
|
17
|
+
isFirstOpen: boolean;
|
|
18
|
+
isSubscribed: boolean;
|
|
19
|
+
isDevUser: boolean;
|
|
20
|
+
init(): Promise<void>;
|
|
21
|
+
storeSessionStructure(): Promise<void>;
|
|
22
|
+
checkFirstOpen(): Promise<void>;
|
|
23
|
+
generateSessionID(): string;
|
|
24
|
+
getSessionData(): any;
|
|
25
|
+
getSessionID(): string | null;
|
|
26
|
+
getIsFirstOpen(): boolean;
|
|
27
|
+
getIsSubscribed(): boolean;
|
|
28
|
+
getIsDevUser(): boolean;
|
|
29
|
+
setIsSubscribed(isSubscribed: boolean): void;
|
|
30
|
+
setIsDevUser(isDevUser: boolean): void;
|
|
31
|
+
}
|
|
32
|
+
|
|
14
33
|
export function initializePushNotifications(): Promise<string>;
|
|
15
34
|
export const networking: Networking;
|
|
16
35
|
export const storage: Storage;
|