tradly 1.0.89 → 1.0.90
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/Constants/PathConstant.js +6 -0
- package/Roots/App.js +74 -0
- package/Roots/User.js +18 -0
- package/package.json +1 -1
|
@@ -99,3 +99,9 @@ export const FEEDBACK_CATEGORIES = "/v1/utils/feedback_categories";
|
|
|
99
99
|
|
|
100
100
|
export const GET_COMMENTS = "/v1/comments";
|
|
101
101
|
export const CREATE_COMMENTS = "/v1/comments";
|
|
102
|
+
|
|
103
|
+
export const ACTIVITIES = "/v1/activities";
|
|
104
|
+
|
|
105
|
+
export const COMMISSIONS = "/v1/commissions";
|
|
106
|
+
|
|
107
|
+
export const LOGOUT = "/v1/users/logout";
|
package/Roots/App.js
CHANGED
|
@@ -59,6 +59,9 @@ import {
|
|
|
59
59
|
GET_COMMENTS,
|
|
60
60
|
CREATE_COMMENTS,
|
|
61
61
|
COUPON,
|
|
62
|
+
ACTIVITIES,
|
|
63
|
+
COMMISSIONS,
|
|
64
|
+
LOGOUT,
|
|
62
65
|
} from "./../Constants/PathConstant.js";
|
|
63
66
|
import serialization from "../Helper/Serialization.js";
|
|
64
67
|
import { ImageConfig } from "../Helper/APIParam.js";
|
|
@@ -2251,6 +2254,77 @@ class App {
|
|
|
2251
2254
|
return error;
|
|
2252
2255
|
}
|
|
2253
2256
|
}
|
|
2257
|
+
|
|
2258
|
+
//MARK:- Activites
|
|
2259
|
+
async getActivities(param = { authKey, bodyParam }) {
|
|
2260
|
+
let url =
|
|
2261
|
+
param.bodyParam == undefined || param.bodyParam == ""
|
|
2262
|
+
? ""
|
|
2263
|
+
: `?${serialization(param.bodyParam)}`;
|
|
2264
|
+
try {
|
|
2265
|
+
const [error, responseJson] = await network.networkCall({
|
|
2266
|
+
path: ACTIVITIES + url,
|
|
2267
|
+
method: Method.GET,
|
|
2268
|
+
authKey: param.authKey,
|
|
2269
|
+
currency: param.currency,
|
|
2270
|
+
});
|
|
2271
|
+
if (error) {
|
|
2272
|
+
return error;
|
|
2273
|
+
} else {
|
|
2274
|
+
return responseJson;
|
|
2275
|
+
}
|
|
2276
|
+
} catch (error) {
|
|
2277
|
+
return error;
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
//MARK:- COMMISSIONS API
|
|
2282
|
+
|
|
2283
|
+
async getCommissions(param = { bodyParam, authKey }) {
|
|
2284
|
+
let url =
|
|
2285
|
+
param.bodyParam == undefined || param.bodyParam == ""
|
|
2286
|
+
? ""
|
|
2287
|
+
: `?${serialization(param.bodyParam)}`;
|
|
2288
|
+
try {
|
|
2289
|
+
const [error, responseJson] = await network.networkCall({
|
|
2290
|
+
path: COMMISSIONS + url,
|
|
2291
|
+
method: Method.GET,
|
|
2292
|
+
authKey: param.authKey,
|
|
2293
|
+
currency: param.currency,
|
|
2294
|
+
});
|
|
2295
|
+
if (error) {
|
|
2296
|
+
return error;
|
|
2297
|
+
} else {
|
|
2298
|
+
return responseJson;
|
|
2299
|
+
}
|
|
2300
|
+
} catch (error) {
|
|
2301
|
+
return error;
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
async getCommissionDetail(param = { id, authKey }) {
|
|
2305
|
+
var path = "";
|
|
2306
|
+
if (param.id != undefined) {
|
|
2307
|
+
if (param.id.length != 0) {
|
|
2308
|
+
path = `/${param.id}`;
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
try {
|
|
2313
|
+
const [error, responseJson] = await network.networkCall({
|
|
2314
|
+
path: COMMISSIONS + `${path}`,
|
|
2315
|
+
method: Method.GET,
|
|
2316
|
+
authKey: param.authKey,
|
|
2317
|
+
currency: param.currency,
|
|
2318
|
+
});
|
|
2319
|
+
if (error) {
|
|
2320
|
+
return error;
|
|
2321
|
+
} else {
|
|
2322
|
+
return responseJson;
|
|
2323
|
+
}
|
|
2324
|
+
} catch (error) {
|
|
2325
|
+
return error;
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2254
2328
|
}
|
|
2255
2329
|
const app = new App();
|
|
2256
2330
|
export default app;
|
package/Roots/User.js
CHANGED
|
@@ -2,6 +2,7 @@ import network, { Method } from "./../NetworkManager/NetworkManager.js";
|
|
|
2
2
|
import {
|
|
3
3
|
FORGOTPASSWORD,
|
|
4
4
|
LOGIN,
|
|
5
|
+
LOGOUT,
|
|
5
6
|
REGISTER,
|
|
6
7
|
SETPASSWORD,
|
|
7
8
|
SOCIAL_LOGIN,
|
|
@@ -122,6 +123,23 @@ class User {
|
|
|
122
123
|
return error;
|
|
123
124
|
}
|
|
124
125
|
}
|
|
126
|
+
|
|
127
|
+
async logout(param = { data }) {
|
|
128
|
+
try {
|
|
129
|
+
const [error, responseJson] = await network.networkCall({
|
|
130
|
+
path: LOGOUT,
|
|
131
|
+
method: Method.POST,
|
|
132
|
+
param: param.data,
|
|
133
|
+
});
|
|
134
|
+
if (error) {
|
|
135
|
+
return error;
|
|
136
|
+
} else {
|
|
137
|
+
return responseJson;
|
|
138
|
+
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
return error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
125
143
|
}
|
|
126
144
|
const user = new User();
|
|
127
145
|
export default user;
|