washday-sdk 0.0.43 → 0.0.44

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.
@@ -0,0 +1,36 @@
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.getCountries = void 0;
16
+ const axiosInstance_1 = __importDefault(require("../axiosInstance"));
17
+ const GET_SET_COUNTRIES = 'api/country';
18
+ const REQUEST_PARAMS = {
19
+ token: 'LOGGED_USER_TOKEN',
20
+ };
21
+ const getCountries = function () {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ try {
24
+ const config = {
25
+ headers: { Authorization: '' }
26
+ };
27
+ const response = yield axiosInstance_1.default.get(`${GET_SET_COUNTRIES}`, config);
28
+ return response;
29
+ }
30
+ catch (error) {
31
+ console.error('Error fetching getCountries:', error);
32
+ throw error;
33
+ }
34
+ });
35
+ };
36
+ exports.getCountries = getCountries;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ "use strict";
package/dist/api/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const get_1 = require("./customers/get");
3
+ const get_1 = require("./countries/get");
4
+ const get_2 = require("./customers/get");
4
5
  const put_1 = require("./products/put");
5
- const get_2 = require("./stores/get");
6
+ const get_3 = require("./stores/get");
6
7
  const post_1 = require("./stores/post");
7
8
  const put_2 = require("./stores/put");
8
9
  const put_3 = require("./users/put");
@@ -12,17 +13,18 @@ const WashdayClient = function WashdayClient(apiToken) {
12
13
  WashdayClient.prototype.stores.apiToken = apiToken;
13
14
  WashdayClient.prototype.products.apiToken = apiToken;
14
15
  WashdayClient.prototype.users.apiToken = apiToken;
16
+ WashdayClient.prototype.countries.apiToken = apiToken;
15
17
  };
16
18
  WashdayClient.prototype.customers = {
17
- getCustomerById: get_1.getCustomerById,
18
- getCustomerHighlightsById: get_1.getCustomerHighlightsById
19
+ getCustomerById: get_2.getCustomerById,
20
+ getCustomerHighlightsById: get_2.getCustomerHighlightsById
19
21
  };
20
22
  WashdayClient.prototype.stores = {
21
- getStores: get_2.getStores,
22
- getStoreById: get_2.getStoreById,
23
+ getStores: get_3.getStores,
24
+ getStoreById: get_3.getStoreById,
23
25
  updateStoreById: put_2.updateStoreById,
24
26
  createStoreImage: post_1.createStoreImage,
25
- getStoreReviewLink: get_2.getStoreReviewLink
27
+ getStoreReviewLink: get_3.getStoreReviewLink
26
28
  };
27
29
  WashdayClient.prototype.products = {
28
30
  bulkUpdate: put_1.bulkUpdate,
@@ -30,4 +32,7 @@ WashdayClient.prototype.products = {
30
32
  WashdayClient.prototype.users = {
31
33
  updateUserById: put_3.updateUserById,
32
34
  };
35
+ WashdayClient.prototype.countries = {
36
+ getCountries: get_1.getCountries,
37
+ };
33
38
  exports.default = WashdayClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,23 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import { ICustomer } from "../../interfaces/Customer";
3
+ import { IOrderInfo } from "../../interfaces/Order";
4
+ import axiosInstance from "../axiosInstance";
5
+
6
+ const GET_SET_COUNTRIES = 'api/country';
7
+ const REQUEST_PARAMS = {
8
+ token: 'LOGGED_USER_TOKEN',
9
+ };
10
+
11
+
12
+ export const getCountries = async function (this: WashdayClientInstance): Promise<any> {
13
+ try {
14
+ const config = {
15
+ headers: { Authorization: '' }
16
+ };
17
+ const response = await axiosInstance.get(`${GET_SET_COUNTRIES}`, config);
18
+ return response;
19
+ } catch (error) {
20
+ console.error('Error fetching getCountries:', error);
21
+ throw error;
22
+ }
23
+ };
File without changes
File without changes
package/src/api/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { WashdayClientInstance } from "../interfaces/Api";
2
+ import { getCountries } from "./countries/get";
2
3
  import { getCustomerById, getCustomerHighlightsById } from "./customers/get";
3
4
  import { bulkUpdate } from "./products/put";
4
5
  import { getStoreById, getStoreReviewLink, getStores } from "./stores/get";
@@ -18,6 +19,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
18
19
  WashdayClient.prototype.stores.apiToken = apiToken;
19
20
  WashdayClient.prototype.products.apiToken = apiToken;
20
21
  WashdayClient.prototype.users.apiToken = apiToken;
22
+ WashdayClient.prototype.countries.apiToken = apiToken;
21
23
  } as any;
22
24
 
23
25
  WashdayClient.prototype.customers = {
@@ -42,4 +44,8 @@ WashdayClient.prototype.users = {
42
44
  updateUserById: updateUserById,
43
45
  };
44
46
 
47
+ WashdayClient.prototype.countries = {
48
+ getCountries: getCountries,
49
+ };
50
+
45
51
  export default WashdayClient;