washday-sdk 0.0.46 → 0.0.48

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.
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.updateCompanyById = void 0;
15
+ exports.updateCFDIOrgLogo = exports.updateCompanyTaxInfoCertificates = exports.updateCompanyTaxInfoById = exports.updateCompanyById = void 0;
16
16
  const axiosInstance_1 = __importDefault(require("../axiosInstance"));
17
17
  const GET_SET_COMPANIES = 'api/company';
18
18
  const updateCompanyById = function (companyId, data) {
@@ -31,3 +31,51 @@ const updateCompanyById = function (companyId, data) {
31
31
  });
32
32
  };
33
33
  exports.updateCompanyById = updateCompanyById;
34
+ const updateCompanyTaxInfoById = function (companyId, data) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ try {
37
+ const config = {
38
+ headers: { Authorization: `Bearer ${this.apiToken}` }
39
+ };
40
+ const response = yield axiosInstance_1.default.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo`, data, config);
41
+ return response;
42
+ }
43
+ catch (error) {
44
+ console.error('Error fetching updateCompanyTaxInfoById:', error);
45
+ throw error;
46
+ }
47
+ });
48
+ };
49
+ exports.updateCompanyTaxInfoById = updateCompanyTaxInfoById;
50
+ const updateCompanyTaxInfoCertificates = function (companyId, data) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ try {
53
+ const config = {
54
+ headers: { Authorization: `Bearer ${this.apiToken}` }
55
+ };
56
+ const response = yield axiosInstance_1.default.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo/certificates`, data, config);
57
+ return response;
58
+ }
59
+ catch (error) {
60
+ console.error('Error fetching updateCompanyTaxInfoById:', error);
61
+ throw error;
62
+ }
63
+ });
64
+ };
65
+ exports.updateCompanyTaxInfoCertificates = updateCompanyTaxInfoCertificates;
66
+ const updateCFDIOrgLogo = function (companyId, data) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ try {
69
+ const config = {
70
+ headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
71
+ };
72
+ const response = yield axiosInstance_1.default.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo/logo`, data, config);
73
+ return response;
74
+ }
75
+ catch (error) {
76
+ console.error('Error fetching updateCFDIOrgLogo:', error);
77
+ throw error;
78
+ }
79
+ });
80
+ };
81
+ exports.updateCFDIOrgLogo = updateCFDIOrgLogo;
package/dist/api/index.js CHANGED
@@ -40,6 +40,9 @@ WashdayClient.prototype.countries = {
40
40
  };
41
41
  WashdayClient.prototype.companies = {
42
42
  getCompanyById: get_1.getCompanyById,
43
- updateCompanyById: put_1.updateCompanyById
43
+ updateCompanyById: put_1.updateCompanyById,
44
+ updateCompanyTaxInfoById: put_1.updateCompanyTaxInfoById,
45
+ updateCompanyTaxInfoCertificates: put_1.updateCompanyTaxInfoCertificates,
46
+ updateCFDIOrgLogo: put_1.updateCFDIOrgLogo
44
47
  };
45
48
  exports.default = WashdayClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -13,4 +13,43 @@ export const updateCompanyById = async function (this: WashdayClientInstance, co
13
13
  console.error('Error fetching updateCompanyById:', error);
14
14
  throw error;
15
15
  }
16
+ };
17
+
18
+ export const updateCompanyTaxInfoById = async function (this: WashdayClientInstance, companyId: string, data: any): Promise<any> {
19
+ try {
20
+ const config = {
21
+ headers: { Authorization: `Bearer ${this.apiToken}` }
22
+ };
23
+ const response = await axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo`, data, config);
24
+ return response;
25
+ } catch (error) {
26
+ console.error('Error fetching updateCompanyTaxInfoById:', error);
27
+ throw error;
28
+ }
29
+ };
30
+
31
+ export const updateCompanyTaxInfoCertificates = async function (this: WashdayClientInstance, companyId: string, data: any): Promise<any> {
32
+ try {
33
+ const config = {
34
+ headers: { Authorization: `Bearer ${this.apiToken}` }
35
+ };
36
+ const response = await axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo/certificates`, data, config);
37
+ return response;
38
+ } catch (error) {
39
+ console.error('Error fetching updateCompanyTaxInfoById:', error);
40
+ throw error;
41
+ }
42
+ };
43
+
44
+ export const updateCFDIOrgLogo = async function (this: WashdayClientInstance, companyId: string, data: any): Promise<any> {
45
+ try {
46
+ const config = {
47
+ headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
48
+ }
49
+ const response = await axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo/logo`, data, config);
50
+ return response;
51
+ } catch (error) {
52
+ console.error('Error fetching updateCFDIOrgLogo:', error);
53
+ throw error;
54
+ }
16
55
  };
package/src/api/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { WashdayClientInstance } from "../interfaces/Api";
2
2
  import { getCompanyById } from "./companies/get";
3
- import { updateCompanyById } from "./companies/put";
3
+ import { updateCFDIOrgLogo, updateCompanyById, updateCompanyTaxInfoById, updateCompanyTaxInfoCertificates } from "./companies/put";
4
4
  import { getCountries } from "./countries/get";
5
5
  import { getCustomerById, getCustomerHighlightsById } from "./customers/get";
6
6
  import { bulkUpdate } from "./products/put";
@@ -53,7 +53,11 @@ WashdayClient.prototype.countries = {
53
53
 
54
54
  WashdayClient.prototype.companies = {
55
55
  getCompanyById: getCompanyById,
56
- updateCompanyById: updateCompanyById
56
+ updateCompanyById: updateCompanyById,
57
+ updateCompanyTaxInfoById: updateCompanyTaxInfoById,
58
+ updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
59
+ updateCFDIOrgLogo: updateCFDIOrgLogo
60
+
57
61
  };
58
62
 
59
63
  export default WashdayClient;