washday-sdk 0.0.45 → 0.0.46

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,33 @@
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.updateCompanyById = void 0;
16
+ const axiosInstance_1 = __importDefault(require("../axiosInstance"));
17
+ const GET_SET_COMPANIES = 'api/company';
18
+ const updateCompanyById = function (companyId, data) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ try {
21
+ const config = {
22
+ headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
23
+ };
24
+ const response = yield axiosInstance_1.default.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
25
+ return response;
26
+ }
27
+ catch (error) {
28
+ console.error('Error fetching updateCompanyById:', error);
29
+ throw error;
30
+ }
31
+ });
32
+ };
33
+ exports.updateCompanyById = updateCompanyById;
package/dist/api/index.js CHANGED
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const get_1 = require("./companies/get");
4
+ const put_1 = require("./companies/put");
4
5
  const get_2 = require("./countries/get");
5
6
  const get_3 = require("./customers/get");
6
- const put_1 = require("./products/put");
7
+ const put_2 = require("./products/put");
7
8
  const get_4 = require("./stores/get");
8
9
  const post_1 = require("./stores/post");
9
- const put_2 = require("./stores/put");
10
- const put_3 = require("./users/put");
10
+ const put_3 = require("./stores/put");
11
+ const put_4 = require("./users/put");
11
12
  const WashdayClient = function WashdayClient(apiToken) {
12
13
  this.apiToken = apiToken;
13
14
  WashdayClient.prototype.customers.apiToken = apiToken;
@@ -24,20 +25,21 @@ WashdayClient.prototype.customers = {
24
25
  WashdayClient.prototype.stores = {
25
26
  getStores: get_4.getStores,
26
27
  getStoreById: get_4.getStoreById,
27
- updateStoreById: put_2.updateStoreById,
28
+ updateStoreById: put_3.updateStoreById,
28
29
  createStoreImage: post_1.createStoreImage,
29
30
  getStoreReviewLink: get_4.getStoreReviewLink
30
31
  };
31
32
  WashdayClient.prototype.products = {
32
- bulkUpdate: put_1.bulkUpdate,
33
+ bulkUpdate: put_2.bulkUpdate,
33
34
  };
34
35
  WashdayClient.prototype.users = {
35
- updateUserById: put_3.updateUserById,
36
+ updateUserById: put_4.updateUserById,
36
37
  };
37
38
  WashdayClient.prototype.countries = {
38
39
  getCountries: get_2.getCountries,
39
40
  };
40
41
  WashdayClient.prototype.companies = {
41
42
  getCompanyById: get_1.getCompanyById,
43
+ updateCompanyById: put_1.updateCompanyById
42
44
  };
43
45
  exports.default = WashdayClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,16 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import axiosInstance from "../axiosInstance";
3
+ const GET_SET_COMPANIES = 'api/company';
4
+
5
+ export const updateCompanyById = async function (this: WashdayClientInstance, companyId: string, data: any): Promise<any> {
6
+ try {
7
+ const config = {
8
+ headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
9
+ };
10
+ const response = await axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
11
+ return response;
12
+ } catch (error) {
13
+ console.error('Error fetching updateCompanyById:', error);
14
+ throw error;
15
+ }
16
+ };
package/src/api/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { WashdayClientInstance } from "../interfaces/Api";
2
2
  import { getCompanyById } from "./companies/get";
3
+ import { updateCompanyById } from "./companies/put";
3
4
  import { getCountries } from "./countries/get";
4
5
  import { getCustomerById, getCustomerHighlightsById } from "./customers/get";
5
6
  import { bulkUpdate } from "./products/put";
@@ -52,6 +53,7 @@ WashdayClient.prototype.countries = {
52
53
 
53
54
  WashdayClient.prototype.companies = {
54
55
  getCompanyById: getCompanyById,
56
+ updateCompanyById: updateCompanyById
55
57
  };
56
58
 
57
59
  export default WashdayClient;