tradly 1.0.71 → 1.0.72

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.
Files changed (2) hide show
  1. package/Roots/SetSDK.js +17 -18
  2. package/package.json +1 -1
package/Roots/SetSDK.js CHANGED
@@ -44,25 +44,24 @@ import app from "./App.js";
44
44
 
45
45
  class SetSDK {
46
46
  async config(init = { domain, env }) {
47
- axios({
48
- url: `https://api.tradly.app/skua/tenants/pk_by_domain?domain=${init.domain}&env=${init.env}`,
49
- method: "GET",
50
- responseType: "json",
51
- headers: {
52
- "Content-Type": "application/json",
53
- },
54
- })
55
- .then((response) => {
56
- if (response.data.status) {
57
- APPCONSTANT.TOKEN = response.data.data.key;
58
- APPCONSTANT.ENVIRONMENT = init.env;
59
- APPCONSTANT.DOMAIN = init.domain;
60
- return true;
61
- }
62
- })
63
- .catch((error) => {
64
- return error.response;
47
+ try {
48
+ const response = await axios({
49
+ url: `https://api.tradly.app/skua/tenants/pk_by_domain?domain=${init.domain}&env=${init.env}`,
50
+ method: "GET",
51
+ responseType: "json",
52
+ headers: {
53
+ "Content-Type": "application/json",
54
+ },
65
55
  });
56
+ if (response.data.status) {
57
+ APPCONSTANT.TOKEN = response.data.data.key;
58
+ APPCONSTANT.ENVIRONMENT = init.env;
59
+ APPCONSTANT.DOMAIN = init.domain;
60
+ return true;
61
+ }
62
+ } catch (error) {
63
+ return error;
64
+ }
66
65
  }
67
66
  }
68
67
  const set_sdk = new SetSDK();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tradly",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
4
4
  "description": "Tradly JS SDK",
5
5
  "main": "index.js",
6
6
  "type": "module",