tradly 1.1.66 → 1.1.68

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.
@@ -98,6 +98,8 @@ export const FOLLOWINGLISTING = "/products/v1/feeds/following?type=listings&";
98
98
 
99
99
  export const LAYER = "/v1/layers";
100
100
 
101
+ export const TAX = "/v1/taxes";
102
+
101
103
  export const TRANSLATIONS = "/v1/translations";
102
104
 
103
105
  export const CLIENTTRANSLATION_GROUPS = "/v1/client_translations/groups";
package/Roots/App.js CHANGED
@@ -81,6 +81,7 @@ import {
81
81
  SHIPMENTS,
82
82
  STATES,
83
83
  SUBSCRIPTION_LISTINGS,
84
+ TAX,
84
85
  } from "./../Constants/PathConstant.js";
85
86
  import serialization from "../Helper/Serialization.js";
86
87
  import { ImageConfig } from "../Helper/APIParam.js";
@@ -861,7 +862,7 @@ class App {
861
862
  const [error, responseJson] = await network.networkCall({
862
863
  path:
863
864
  LISTINGS +
864
- `/${param.listing_id}/price_rules/${rule_id}`,
865
+ `/${param.listing_id}/price_rules/${param.rule_id}`,
865
866
  method: Method.DELETE,
866
867
  authKey: param.authKey,
867
868
  currency: param.currency,
@@ -3044,6 +3045,75 @@ class App {
3044
3045
  return error;
3045
3046
  }
3046
3047
  }
3048
+ //MARK:-  /v1/taxes 
3049
+ async getListingTaxes(param = { authKey, bodyParam }) {
3050
+ let url =
3051
+ param.bodyParam == undefined || param.bodyParam == ""
3052
+ ? ""
3053
+ : `?${serialization(param.bodyParam)}`;
3054
+ try {
3055
+ const [error, responseJson] = await network.networkCall({
3056
+ path: TAX + url,
3057
+ method: Method.GET,
3058
+ authKey: param.authKey,
3059
+ currency: param.currency,
3060
+ language: param.language,
3061
+ });
3062
+ if (error) {
3063
+ return error;
3064
+ } else {
3065
+ return responseJson;
3066
+ }
3067
+ } catch (error) {
3068
+ return error;
3069
+ }
3070
+ }
3071
+
3072
+ async addEditListingTax(param = { id, authKey, data }) {
3073
+ let method =
3074
+ param.id == undefined || param.id == ""
3075
+ ? Method.POST
3076
+ : Method.PATCH;
3077
+ let path =
3078
+ param.id == undefined || param.id == ""
3079
+ ? TAX
3080
+ : TAX + `/${param.id}`;
3081
+ try {
3082
+ const [error, responseJson] = await network.networkCall({
3083
+ path: path,
3084
+ method: method,
3085
+ authKey: param.authKey,
3086
+ currency: param.currency,
3087
+ language: param.language,
3088
+ param: param.data,
3089
+ });
3090
+ if (error) {
3091
+ return error;
3092
+ } else {
3093
+ return responseJson;
3094
+ }
3095
+ } catch (error) {
3096
+ return error;
3097
+ }
3098
+ }
3099
+ async deleteListingTax(param = { id, authKey }) {
3100
+ try {
3101
+ const [error, responseJson] = await network.networkCall({
3102
+ path: TAX + `/${param.id}`,
3103
+ method: Method.DELETE,
3104
+ authKey: param.authKey,
3105
+ currency: param.currency,
3106
+ language: param.language,
3107
+ });
3108
+ if (error) {
3109
+ return error;
3110
+ } else {
3111
+ return responseJson;
3112
+ }
3113
+ } catch (error) {
3114
+ return error;
3115
+ }
3116
+ }
3047
3117
 
3048
3118
  // Translations
3049
3119
  async translateData(param = { id, authKey, data }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tradly",
3
- "version": "1.1.66",
3
+ "version": "1.1.68",
4
4
  "description": "Tradly JS SDK",
5
5
  "main": "index.js",
6
6
  "type": "module",