washday-sdk 0.0.48 → 0.0.49

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.
@@ -1 +1,49 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.updateCFDIOrgLogo = exports.updateCompanyTaxInfoCertificates = void 0;
16
+ const axiosInstance_1 = __importDefault(require("../axiosInstance"));
17
+ const GET_SET_COMPANIES = 'api/company';
18
+ const updateCompanyTaxInfoCertificates = function (companyId, data) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ try {
21
+ const config = {
22
+ headers: { Authorization: `Bearer ${this.apiToken}` }
23
+ };
24
+ const response = yield axiosInstance_1.default.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/certificates`, data, config);
25
+ return response;
26
+ }
27
+ catch (error) {
28
+ console.error('Error fetching updateCompanyTaxInfoById:', error);
29
+ throw error;
30
+ }
31
+ });
32
+ };
33
+ exports.updateCompanyTaxInfoCertificates = updateCompanyTaxInfoCertificates;
34
+ const updateCFDIOrgLogo = function (companyId, data) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ try {
37
+ const config = {
38
+ headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
39
+ };
40
+ const response = yield axiosInstance_1.default.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/logo`, data, config);
41
+ return response;
42
+ }
43
+ catch (error) {
44
+ console.error('Error fetching updateCFDIOrgLogo:', error);
45
+ throw error;
46
+ }
47
+ });
48
+ };
49
+ exports.updateCFDIOrgLogo = updateCFDIOrgLogo;
@@ -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.updateCFDIOrgLogo = exports.updateCompanyTaxInfoCertificates = exports.updateCompanyTaxInfoById = exports.updateCompanyById = void 0;
15
+ 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,35 +47,3 @@ 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
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const get_1 = require("./companies/get");
4
+ const post_1 = require("./companies/post");
4
5
  const put_1 = require("./companies/put");
5
6
  const get_2 = require("./countries/get");
6
7
  const get_3 = require("./customers/get");
7
8
  const put_2 = require("./products/put");
8
9
  const get_4 = require("./stores/get");
9
- const post_1 = require("./stores/post");
10
+ const post_2 = require("./stores/post");
10
11
  const put_3 = require("./stores/put");
11
12
  const put_4 = require("./users/put");
12
13
  const WashdayClient = function WashdayClient(apiToken) {
@@ -26,7 +27,7 @@ WashdayClient.prototype.stores = {
26
27
  getStores: get_4.getStores,
27
28
  getStoreById: get_4.getStoreById,
28
29
  updateStoreById: put_3.updateStoreById,
29
- createStoreImage: post_1.createStoreImage,
30
+ createStoreImage: post_2.createStoreImage,
30
31
  getStoreReviewLink: get_4.getStoreReviewLink
31
32
  };
32
33
  WashdayClient.prototype.products = {
@@ -42,7 +43,7 @@ WashdayClient.prototype.companies = {
42
43
  getCompanyById: get_1.getCompanyById,
43
44
  updateCompanyById: put_1.updateCompanyById,
44
45
  updateCompanyTaxInfoById: put_1.updateCompanyTaxInfoById,
45
- updateCompanyTaxInfoCertificates: put_1.updateCompanyTaxInfoCertificates,
46
- updateCFDIOrgLogo: put_1.updateCFDIOrgLogo
46
+ updateCompanyTaxInfoCertificates: post_1.updateCompanyTaxInfoCertificates,
47
+ updateCFDIOrgLogo: post_1.updateCFDIOrgLogo
47
48
  };
48
49
  exports.default = WashdayClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,29 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import axiosInstance from "../axiosInstance";
3
+ const GET_SET_COMPANIES = 'api/company';
4
+
5
+ export const updateCompanyTaxInfoCertificates = async function (this: WashdayClientInstance, companyId: string, data: any): Promise<any> {
6
+ try {
7
+ const config = {
8
+ headers: { Authorization: `Bearer ${this.apiToken}` }
9
+ };
10
+ const response = await axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/certificates`, data, config);
11
+ return response;
12
+ } catch (error) {
13
+ console.error('Error fetching updateCompanyTaxInfoById:', error);
14
+ throw error;
15
+ }
16
+ };
17
+
18
+ export const updateCFDIOrgLogo = async function (this: WashdayClientInstance, companyId: string, data: any): Promise<any> {
19
+ try {
20
+ const config = {
21
+ headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
22
+ }
23
+ const response = await axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/logo`, data, config);
24
+ return response;
25
+ } catch (error) {
26
+ console.error('Error fetching updateCFDIOrgLogo:', error);
27
+ throw error;
28
+ }
29
+ };
@@ -27,29 +27,3 @@ export const updateCompanyTaxInfoById = async function (this: WashdayClientInsta
27
27
  throw error;
28
28
  }
29
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
- }
55
- };
package/src/api/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { WashdayClientInstance } from "../interfaces/Api";
2
2
  import { getCompanyById } from "./companies/get";
3
- import { updateCFDIOrgLogo, updateCompanyById, updateCompanyTaxInfoById, updateCompanyTaxInfoCertificates } from "./companies/put";
3
+ import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
4
+ import { updateCompanyById, updateCompanyTaxInfoById } from "./companies/put";
4
5
  import { getCountries } from "./countries/get";
5
6
  import { getCustomerById, getCustomerHighlightsById } from "./customers/get";
6
7
  import { bulkUpdate } from "./products/put";