washday-sdk 0.0.50 → 0.0.52

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,14 +12,14 @@ 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.updateCompanyTaxInfoById = exports.updateCompanyLogoById = 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) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
20
  try {
21
21
  const config = {
22
- headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
22
+ headers: { Authorization: `Bearer ${this.apiToken}` }
23
23
  };
24
24
  const response = yield axiosInstance_1.default.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
25
25
  return response;
@@ -31,6 +31,23 @@ const updateCompanyById = function (companyId, data) {
31
31
  });
32
32
  };
33
33
  exports.updateCompanyById = updateCompanyById;
34
+ const updateCompanyLogoById = function (companyId, data) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ try {
37
+ //TODO: company logo requires to have content-type false?
38
+ const config = {
39
+ headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
40
+ };
41
+ const response = yield axiosInstance_1.default.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
42
+ return response;
43
+ }
44
+ catch (error) {
45
+ console.error('Error fetching updateCompanyLogoById:', error);
46
+ throw error;
47
+ }
48
+ });
49
+ };
50
+ exports.updateCompanyLogoById = updateCompanyLogoById;
34
51
  const updateCompanyTaxInfoById = function (companyId, data) {
35
52
  return __awaiter(this, void 0, void 0, function* () {
36
53
  try {
package/dist/api/index.js CHANGED
@@ -44,6 +44,7 @@ WashdayClient.prototype.countries = {
44
44
  WashdayClient.prototype.companies = {
45
45
  getCompanyById: get_1.getCompanyById,
46
46
  updateCompanyById: put_1.updateCompanyById,
47
+ updateCompanyLogoById: put_1.updateCompanyLogoById,
47
48
  updateCompanyTaxInfoById: put_1.updateCompanyTaxInfoById,
48
49
  updateCompanyTaxInfoCertificates: post_1.updateCompanyTaxInfoCertificates,
49
50
  updateCFDIOrgLogo: post_1.updateCFDIOrgLogo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -5,7 +5,7 @@ const GET_SET_COMPANIES = 'api/company';
5
5
  export const updateCompanyById = async function (this: WashdayClientInstance, companyId: string, data: any): Promise<any> {
6
6
  try {
7
7
  const config = {
8
- headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
8
+ headers: { Authorization: `Bearer ${this.apiToken}` }
9
9
  };
10
10
  const response = await axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
11
11
  return response;
@@ -15,6 +15,20 @@ export const updateCompanyById = async function (this: WashdayClientInstance, co
15
15
  }
16
16
  };
17
17
 
18
+ export const updateCompanyLogoById = async function (this: WashdayClientInstance, companyId: string, data: any): Promise<any> {
19
+ try {
20
+ //TODO: company logo requires to have content-type false?
21
+ const config = {
22
+ headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
23
+ };
24
+ const response = await axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
25
+ return response;
26
+ } catch (error) {
27
+ console.error('Error fetching updateCompanyLogoById:', error);
28
+ throw error;
29
+ }
30
+ };
31
+
18
32
  export const updateCompanyTaxInfoById = async function (this: WashdayClientInstance, companyId: string, data: any): Promise<any> {
19
33
  try {
20
34
  const config = {
package/src/api/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { WashdayClientInstance } from "../interfaces/Api";
2
2
  import { getCompanyById } from "./companies/get";
3
3
  import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
4
- import { updateCompanyById, updateCompanyTaxInfoById } from "./companies/put";
4
+ import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
5
5
  import { getCountries } from "./countries/get";
6
6
  import { getCustomerById, getCustomerHighlightsById } from "./customers/get";
7
7
  import { bulkUpdate } from "./products/put";
@@ -57,6 +57,7 @@ WashdayClient.prototype.countries = {
57
57
  WashdayClient.prototype.companies = {
58
58
  getCompanyById: getCompanyById,
59
59
  updateCompanyById: updateCompanyById,
60
+ updateCompanyLogoById: updateCompanyLogoById,
60
61
  updateCompanyTaxInfoById: updateCompanyTaxInfoById,
61
62
  updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
62
63
  updateCFDIOrgLogo: updateCFDIOrgLogo
@@ -2,7 +2,9 @@ import { WashdayClientInstance } from "../../interfaces/Api";
2
2
  import axiosInstance from "../axiosInstance";
3
3
  const GET_SET_STRIPE = 'api/stripe';
4
4
 
5
- export const createCreateSuscriptionCheckoutSession = async function (this: WashdayClientInstance, data?: any): Promise<any> {
5
+ export const createCreateSuscriptionCheckoutSession = async function (this: WashdayClientInstance, data: {
6
+ priceId: string
7
+ }): Promise<any> {
6
8
  try {
7
9
  const config = {
8
10
  headers: { Authorization: `Bearer ${this.apiToken}` }