washday-sdk 0.0.57 → 0.0.58

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/index.js CHANGED
@@ -35,6 +35,7 @@ WashdayClient.prototype.customers = {
35
35
  WashdayClient.prototype.stores = {
36
36
  getStores: get_6.getStores,
37
37
  getStoreById: get_6.getStoreById,
38
+ createStore: post_3.createStore,
38
39
  updateStoreById: put_4.updateStoreById,
39
40
  createStoreImage: post_3.createStoreImage,
40
41
  getStoreReviewLink: get_6.getStoreReviewLink,
@@ -12,9 +12,10 @@ 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.createStoreImage = void 0;
15
+ exports.createStore = exports.createStoreImage = void 0;
16
16
  const axiosInstance_1 = __importDefault(require("../axiosInstance"));
17
17
  const GET_SET_STORE_IMAGE = 'api/store-image';
18
+ const GET_SET_STORES = 'api/store';
18
19
  const createStoreImage = function (data) {
19
20
  return __awaiter(this, void 0, void 0, function* () {
20
21
  try {
@@ -31,3 +32,19 @@ const createStoreImage = function (data) {
31
32
  });
32
33
  };
33
34
  exports.createStoreImage = createStoreImage;
35
+ const createStore = function (data) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ try {
38
+ const config = {
39
+ headers: { Authorization: `Bearer ${this.apiToken}` }
40
+ };
41
+ const response = yield axiosInstance_1.default.post(`${GET_SET_STORES}`, data, config);
42
+ return response;
43
+ }
44
+ catch (error) {
45
+ console.error('Error fetching createStore:', error);
46
+ throw error;
47
+ }
48
+ });
49
+ };
50
+ exports.createStore = createStore;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/api/index.ts CHANGED
@@ -11,7 +11,7 @@ import { getStoreStaff, getStoreStaffById } from "./staff/get";
11
11
  import { createStoreStaff } from "./staff/post";
12
12
  import { updateStoreStaffById } from "./staff/put";
13
13
  import { getStoreById, getStoreReviewLink, getStores } from "./stores/get";
14
- import { createStoreImage } from "./stores/post";
14
+ import { createStore, createStoreImage } from "./stores/post";
15
15
  import { deleteStoreById, updateStoreById } from "./stores/put";
16
16
  import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession } from "./stripe/post";
17
17
  import { updateUserById } from "./users/put";
@@ -43,6 +43,7 @@ WashdayClient.prototype.customers = {
43
43
  WashdayClient.prototype.stores = {
44
44
  getStores: getStores,
45
45
  getStoreById: getStoreById,
46
+ createStore: createStore,
46
47
  updateStoreById: updateStoreById,
47
48
  createStoreImage: createStoreImage,
48
49
  getStoreReviewLink: getStoreReviewLink,
@@ -3,6 +3,7 @@ import { IStore } from "../../interfaces/Store";
3
3
  import axiosInstance from "../axiosInstance";
4
4
 
5
5
  const GET_SET_STORE_IMAGE = 'api/store-image';
6
+ const GET_SET_STORES = 'api/store';
6
7
 
7
8
  export const createStoreImage = async function (this: WashdayClientInstance, data: any): Promise<any> {
8
9
  try {
@@ -15,4 +16,17 @@ export const createStoreImage = async function (this: WashdayClientInstance, dat
15
16
  console.error('Error fetching createStoreImage:', error);
16
17
  throw error;
17
18
  }
19
+ };
20
+
21
+ export const createStore = async function (this: WashdayClientInstance, data: any): Promise<any> {
22
+ try {
23
+ const config = {
24
+ headers: { Authorization: `Bearer ${this.apiToken}` }
25
+ };
26
+ const response = await axiosInstance.post(`${GET_SET_STORES}`, data, config);
27
+ return response;
28
+ } catch (error) {
29
+ console.error('Error fetching createStore:', error);
30
+ throw error;
31
+ }
18
32
  };