washday-sdk 0.0.47 → 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.
- package/dist/api/companies/put.js +33 -1
- package/dist/api/index.js +3 -1
- package/package.json +1 -1
- package/src/api/companies/put.ts +26 -0
- package/src/api/index.ts +4 -2
|
@@ -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.updateCompanyTaxInfoById = 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) {
|
|
@@ -47,3 +47,35 @@ const updateCompanyTaxInfoById = function (companyId, data) {
|
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
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
|
@@ -41,6 +41,8 @@ WashdayClient.prototype.countries = {
|
|
|
41
41
|
WashdayClient.prototype.companies = {
|
|
42
42
|
getCompanyById: get_1.getCompanyById,
|
|
43
43
|
updateCompanyById: put_1.updateCompanyById,
|
|
44
|
-
updateCompanyTaxInfoById: put_1.updateCompanyTaxInfoById
|
|
44
|
+
updateCompanyTaxInfoById: put_1.updateCompanyTaxInfoById,
|
|
45
|
+
updateCompanyTaxInfoCertificates: put_1.updateCompanyTaxInfoCertificates,
|
|
46
|
+
updateCFDIOrgLogo: put_1.updateCFDIOrgLogo
|
|
45
47
|
};
|
|
46
48
|
exports.default = WashdayClient;
|
package/package.json
CHANGED
package/src/api/companies/put.ts
CHANGED
|
@@ -26,4 +26,30 @@ export const updateCompanyTaxInfoById = async function (this: WashdayClientInsta
|
|
|
26
26
|
console.error('Error fetching updateCompanyTaxInfoById:', error);
|
|
27
27
|
throw error;
|
|
28
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
|
+
}
|
|
29
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, updateCompanyTaxInfoById } 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";
|
|
@@ -54,7 +54,9 @@ WashdayClient.prototype.countries = {
|
|
|
54
54
|
WashdayClient.prototype.companies = {
|
|
55
55
|
getCompanyById: getCompanyById,
|
|
56
56
|
updateCompanyById: updateCompanyById,
|
|
57
|
-
updateCompanyTaxInfoById: updateCompanyTaxInfoById
|
|
57
|
+
updateCompanyTaxInfoById: updateCompanyTaxInfoById,
|
|
58
|
+
updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
|
|
59
|
+
updateCFDIOrgLogo: updateCFDIOrgLogo
|
|
58
60
|
|
|
59
61
|
};
|
|
60
62
|
|