tradly 1.0.74 → 1.0.76

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.
@@ -16,6 +16,7 @@ export const CONFIGLIST = "/v1/configs?key_group=";
16
16
  export const GROUPCONFIGLIST = "/v1/configs/list_grouped?key_group=";
17
17
 
18
18
  export const LOGIN = "/v1/users/login";
19
+ export const SOCIAL_LOGIN = "/v1/users/social_login";
19
20
  export const REGISTER = "/v1/users/register";
20
21
  export const VERIFY = "/v1/users/verify";
21
22
  export const FORGOTPASSWORD = "/v1/users/password/recovery";
@@ -49,7 +50,8 @@ export const VARIANTTYPES = "/products/v1/variant_types";
49
50
  export const VARIANTS = "/variants";
50
51
 
51
52
  export const PAYMENTSMETHODS = "/v1/tenants/payment_methods";
52
- export const SHIPPINGMETHOD = "/v1/tenants/shipping_methods";
53
+ export const TENANTSHIPPINGMETHOD = "/v1/tenants/shipping_methods";
54
+ export const SHIPPINGMETHOD = "/v1/shipping_methods";
53
55
 
54
56
  export const S3SIGNEDURL = "/v1/utils/S3signedUploadURL";
55
57
  export const SEARCHADDRESS = "/v1/addresses/search?key=";
package/Roots/App.js CHANGED
@@ -46,6 +46,7 @@ import {
46
46
  LAYER,
47
47
  FOLLOWINGLISTING,
48
48
  GROUPCONFIGLIST,
49
+ TENANTSHIPPINGMETHOD,
49
50
  } from "./../Constants/PathConstant.js";
50
51
  import serialization from "../Helper/Serialization.js";
51
52
  import { ImageConfig } from "../Helper/APIParam.js";
@@ -1501,10 +1502,13 @@ class App {
1501
1502
  return error;
1502
1503
  }
1503
1504
  }
1504
- async getShippingMethods(param = { authKey }) {
1505
+ async getShippingMethods(param = { authKey, type, account_id }) {
1505
1506
  try {
1506
1507
  const [error, responseJson] = await network.networkCall({
1507
- path: SHIPPINGMETHOD,
1508
+ path:
1509
+ param.type === "tenant"
1510
+ ? TENANTSHIPPINGMETHOD
1511
+ : `${SHIPPINGMETHOD}?account_id:${account_id}`,
1508
1512
  method: Method.GET,
1509
1513
  authKey: param.authKey,
1510
1514
  });
package/Roots/User.js CHANGED
@@ -1,44 +1,127 @@
1
-
2
- import network, { Method } from "./../NetworkManager/NetworkManager.js"
3
- import {FORGOTPASSWORD, LOGIN, REGISTER,SETPASSWORD,VERIFY} from './../Constants/PathConstant.js'
1
+ import network, { Method } from "./../NetworkManager/NetworkManager.js";
2
+ import {
3
+ FORGOTPASSWORD,
4
+ LOGIN,
5
+ REGISTER,
6
+ SETPASSWORD,
7
+ SOCIAL_LOGIN,
8
+ VERIFY,
9
+ } from "./../Constants/PathConstant.js";
4
10
  import { UserParameter } from "../Helper/APIParam.js";
5
11
 
6
12
  class User {
7
- async login(param = UserParameter) {
8
- try { const [error,responseJson] = await network.networkCall({path:LOGIN,method:Method.POST,param:param.data});
9
- if (error) { return error
10
- } else { return responseJson}
11
- } catch (error) { return error}
12
- }
13
- async register(param = UserParameter) {
14
- try { const [error,responseJson] = await network.networkCall({path:REGISTER,method:Method.POST,param:param.data});
15
- if (error) { return error} else { return responseJson }
16
- } catch (error) { return error }
17
- }
18
- async verify(param = UserParameter) {
19
- try { const [error,responseJson] = await network.networkCall({path:VERIFY,method:Method.POST,param:param.data});
20
- if (error) {return error
21
- } else { return responseJson }
22
- } catch (error) { return error}
23
- }
24
- async resendOTP(param = UserParameter) {
25
- try { const [error,responseJson] = await network.networkCall({path:REGISTER,method:Method.POST,param:param.data});
26
- if (error) { return error
27
- } else { return responseJson}
28
- } catch (error) { return error}
29
- }
30
- async forgotPassword(param = UserParameter) {
31
- try { const [error,responseJson] = await network.networkCall({path:FORGOTPASSWORD,method:Method.POST,param:param.data});
32
- if (error) { return error
33
- } else { return responseJson}
34
- } catch (error) { return error}
35
- }
36
- async setPassword(param = UserParameter) {
37
- try { const [error,responseJson] = await network.networkCall({path:SETPASSWORD,method:Method.POST,param:param.data});
38
- if (error) { return error
39
- } else { return responseJson}
40
- } catch (error) { return error}
41
- }
13
+ async login(param = UserParameter) {
14
+ try {
15
+ const [error, responseJson] = await network.networkCall({
16
+ path: LOGIN,
17
+ method: Method.POST,
18
+ param: param.data,
19
+ });
20
+ if (error) {
21
+ return error;
22
+ } else {
23
+ return responseJson;
24
+ }
25
+ } catch (error) {
26
+ return error;
27
+ }
28
+ }
29
+ async social_login(param = UserParameter) {
30
+ try {
31
+ const [error, responseJson] = await network.networkCall({
32
+ path: SOCIAL_LOGIN,
33
+ method: Method.POST,
34
+ param: param.data,
35
+ });
36
+ if (error) {
37
+ return error;
38
+ } else {
39
+ return responseJson;
40
+ }
41
+ } catch (error) {
42
+ return error;
43
+ }
44
+ }
45
+ async register(param = UserParameter) {
46
+ try {
47
+ const [error, responseJson] = await network.networkCall({
48
+ path: REGISTER,
49
+ method: Method.POST,
50
+ param: param.data,
51
+ });
52
+ if (error) {
53
+ return error;
54
+ } else {
55
+ return responseJson;
56
+ }
57
+ } catch (error) {
58
+ return error;
59
+ }
60
+ }
61
+ async verify(param = UserParameter) {
62
+ try {
63
+ const [error, responseJson] = await network.networkCall({
64
+ path: VERIFY,
65
+ method: Method.POST,
66
+ param: param.data,
67
+ });
68
+ if (error) {
69
+ return error;
70
+ } else {
71
+ return responseJson;
72
+ }
73
+ } catch (error) {
74
+ return error;
75
+ }
76
+ }
77
+ async resendOTP(param = UserParameter) {
78
+ try {
79
+ const [error, responseJson] = await network.networkCall({
80
+ path: REGISTER,
81
+ method: Method.POST,
82
+ param: param.data,
83
+ });
84
+ if (error) {
85
+ return error;
86
+ } else {
87
+ return responseJson;
88
+ }
89
+ } catch (error) {
90
+ return error;
91
+ }
92
+ }
93
+ async forgotPassword(param = UserParameter) {
94
+ try {
95
+ const [error, responseJson] = await network.networkCall({
96
+ path: FORGOTPASSWORD,
97
+ method: Method.POST,
98
+ param: param.data,
99
+ });
100
+ if (error) {
101
+ return error;
102
+ } else {
103
+ return responseJson;
104
+ }
105
+ } catch (error) {
106
+ return error;
107
+ }
108
+ }
109
+ async setPassword(param = UserParameter) {
110
+ try {
111
+ const [error, responseJson] = await network.networkCall({
112
+ path: SETPASSWORD,
113
+ method: Method.POST,
114
+ param: param.data,
115
+ });
116
+ if (error) {
117
+ return error;
118
+ } else {
119
+ return responseJson;
120
+ }
121
+ } catch (error) {
122
+ return error;
123
+ }
124
+ }
42
125
  }
43
126
  const user = new User();
44
- export default user;
127
+ export default user;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tradly",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
4
4
  "description": "Tradly JS SDK",
5
5
  "main": "index.js",
6
6
  "type": "module",