tradly 1.1.58 → 1.1.60
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 +1 -0
- package/Roots/App.js +69 -0
- package/package.json +1 -1
|
@@ -118,6 +118,7 @@ export const COMMISSIONS = "/v1/commissions";
|
|
|
118
118
|
export const LOGOUT = "/v1/users/logout";
|
|
119
119
|
|
|
120
120
|
export const SUBSCRIPTION = "/v1/subscriptions/subscribe";
|
|
121
|
+
export const SUBSCRIPTION_LISTINGS = "/v1/subscription_products";
|
|
121
122
|
export const SUBSCRIPTION_CONFIRM = "/v1/subscriptions/subscribe/confirm";
|
|
122
123
|
export const SUBSCRIPTION_MANAGE = "/v1/subscriptions/manage";
|
|
123
124
|
export const SUBSCRIPTION_EMAIL_TRIGGER = "/v1/subscriptions/email_trigger";
|
package/Roots/App.js
CHANGED
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
SAVED_CARD,
|
|
81
81
|
SHIPMENTS,
|
|
82
82
|
STATES,
|
|
83
|
+
SUBSCRIPTION_LISTINGS,
|
|
83
84
|
} from "./../Constants/PathConstant.js";
|
|
84
85
|
import serialization from "../Helper/Serialization.js";
|
|
85
86
|
import { ImageConfig } from "../Helper/APIParam.js";
|
|
@@ -1559,6 +1560,28 @@ class App {
|
|
|
1559
1560
|
return error;
|
|
1560
1561
|
}
|
|
1561
1562
|
}
|
|
1563
|
+
async getAttributesGrouped(param = { bodyParam, authKey }) {
|
|
1564
|
+
let url =
|
|
1565
|
+
param.bodyParam == undefined || param.bodyParam == ""
|
|
1566
|
+
? ""
|
|
1567
|
+
: `?${serialization(param.bodyParam)}`;
|
|
1568
|
+
try {
|
|
1569
|
+
const [error, responseJson] = await network.networkCall({
|
|
1570
|
+
path: ATTRIBUTE + "/grouped" + url,
|
|
1571
|
+
method: Method.GET,
|
|
1572
|
+
authKey: param.authKey,
|
|
1573
|
+
currency: param.currency,
|
|
1574
|
+
language: param.language,
|
|
1575
|
+
});
|
|
1576
|
+
if (error) {
|
|
1577
|
+
return error;
|
|
1578
|
+
} else {
|
|
1579
|
+
return responseJson;
|
|
1580
|
+
}
|
|
1581
|
+
} catch (error) {
|
|
1582
|
+
return error;
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1562
1585
|
async addEditAttribute(param = { id, data, authKey }) {
|
|
1563
1586
|
let path =
|
|
1564
1587
|
param.id == undefined || param.id == ""
|
|
@@ -3611,6 +3634,52 @@ class App {
|
|
|
3611
3634
|
return error;
|
|
3612
3635
|
}
|
|
3613
3636
|
}
|
|
3637
|
+
|
|
3638
|
+
// get subscription
|
|
3639
|
+
async getSubscriptionList(param = { authKey, bodyParam }) {
|
|
3640
|
+
let url =
|
|
3641
|
+
param.bodyParam == undefined || param.bodyParam == ""
|
|
3642
|
+
? ""
|
|
3643
|
+
: `?${serialization(param.bodyParam)}`;
|
|
3644
|
+
try {
|
|
3645
|
+
const [error, responseJson] = await network.networkCall({
|
|
3646
|
+
path: `${SUBSCRIPTION_LISTINGS}${url}`,
|
|
3647
|
+
method: Method.GET,
|
|
3648
|
+
authKey: param.authKey,
|
|
3649
|
+
currency: param.currency,
|
|
3650
|
+
language: param.language,
|
|
3651
|
+
});
|
|
3652
|
+
if (error) {
|
|
3653
|
+
return error;
|
|
3654
|
+
} else {
|
|
3655
|
+
return responseJson;
|
|
3656
|
+
}
|
|
3657
|
+
} catch (error) {
|
|
3658
|
+
return error;
|
|
3659
|
+
}
|
|
3660
|
+
}
|
|
3661
|
+
|
|
3662
|
+
// get subscription details
|
|
3663
|
+
async getSubscriptionDetails(param = { listing_id, authKey }) {
|
|
3664
|
+
try {
|
|
3665
|
+
const [error, responseJson] = await network.networkCall({
|
|
3666
|
+
path: `${SUBSCRIPTION_LISTINGS}/${param.listing_id}`,
|
|
3667
|
+
method: Method.GET,
|
|
3668
|
+
authKey: param.authKey,
|
|
3669
|
+
currency: param.currency,
|
|
3670
|
+
language: param.language,
|
|
3671
|
+
});
|
|
3672
|
+
if (error) {
|
|
3673
|
+
return error;
|
|
3674
|
+
} else {
|
|
3675
|
+
return responseJson;
|
|
3676
|
+
}
|
|
3677
|
+
} catch (error) {
|
|
3678
|
+
return error;
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
|
|
3682
|
+
// post subscription
|
|
3614
3683
|
}
|
|
3615
3684
|
const app = new App();
|
|
3616
3685
|
export default app;
|