@suprsend/web-sdk 0.1.24 → 0.1.25
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suprsend/web-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "This is sdk used to integrate suprsend functionality in javascript applications",
|
|
5
5
|
"main": "dist/cjs_bundle.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"@babel/core": "^7.15.0",
|
|
27
27
|
"@babel/preset-env": "^7.15.0",
|
|
28
28
|
"babel-loader": "^8.2.2",
|
|
29
|
-
"minify": "^8.0.3",
|
|
30
29
|
"webpack": "^5.51.1",
|
|
31
30
|
"webpack-cli": "^4.8.0"
|
|
32
31
|
},
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import utils from "./utils";
|
|
2
2
|
import config from "./config";
|
|
3
3
|
import User from "./user";
|
|
4
|
-
import
|
|
4
|
+
import WebPush from "./web_push";
|
|
5
5
|
import { constants } from "./constants";
|
|
6
6
|
import { SSConfigurationError } from "./errors";
|
|
7
7
|
|
|
@@ -24,8 +24,8 @@ class SuprSend {
|
|
|
24
24
|
}
|
|
25
25
|
suprSendInstance.distinct_id = distinct_id;
|
|
26
26
|
this.user = new User(suprSendInstance);
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
27
|
+
this.web_push = new WebPush(suprSendInstance);
|
|
28
|
+
this.web_push.update_subscription();
|
|
29
29
|
SuprSend.setEnvProperties();
|
|
30
30
|
utils.bulk_call_api();
|
|
31
31
|
}
|
|
@@ -101,7 +101,7 @@ class SuprSend {
|
|
|
101
101
|
utils.set_cookie(constants.distinct_id, unique_id);
|
|
102
102
|
suprSendInstance.distinct_id = unique_id;
|
|
103
103
|
suprSendInstance._user_identified = true;
|
|
104
|
-
this.
|
|
104
|
+
this.web_push.update_subscription();
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -138,7 +138,7 @@ class SuprSend {
|
|
|
138
138
|
};
|
|
139
139
|
utils.remove_local_storage_item(constants.super_properties_key);
|
|
140
140
|
this.user = new User(suprSendInstance);
|
|
141
|
-
this.
|
|
141
|
+
this.web_push = new WebPush(suprSendInstance);
|
|
142
142
|
SuprSend.setEnvProperties();
|
|
143
143
|
}
|
|
144
144
|
}
|
|
@@ -4,7 +4,7 @@ import User from "./user";
|
|
|
4
4
|
import { init_at } from "./index";
|
|
5
5
|
|
|
6
6
|
var notification_timer;
|
|
7
|
-
class
|
|
7
|
+
class WebPush {
|
|
8
8
|
constructor(instance) {
|
|
9
9
|
this.instance = instance;
|
|
10
10
|
this.user = new User(instance);
|
|
@@ -120,4 +120,4 @@ class ServiceWorker {
|
|
|
120
120
|
// };
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
export default
|
|
123
|
+
export default WebPush;
|