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 CHANGED
@@ -7,4 +7,4 @@ export const ENDPOINTS = {
7
7
  SET_ATTRIBUTION: 'https://ap0404.gways.org/user/set_attribution_data',
8
8
  }
9
9
 
10
- export const DEBUG_MODE = false;
10
+ export const DEBUG_MODE = true;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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 session {
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();
@@ -1,4 +1,5 @@
1
1
  export { default as NotificationsPush } from './Notifications';
2
2
  export { default as Networking } from './Networking';
3
3
  export { default as Storage } from './Storage';
4
+ export { default as Session } from './Session';
4
5
 
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;