washday-sdk 0.0.71 → 0.0.72

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.
Files changed (145) hide show
  1. package/dist/api/axiosInstance.d.ts +2 -0
  2. package/dist/api/axiosInstance.js +4 -8
  3. package/dist/api/cashierbox/delete.d.ts +2 -0
  4. package/dist/api/cashierbox/delete.js +3 -10
  5. package/dist/api/cashierbox/get.d.ts +7 -0
  6. package/dist/api/cashierbox/get.js +7 -16
  7. package/dist/api/cashierbox/post.d.ts +11 -0
  8. package/dist/api/cashierbox/post.js +5 -13
  9. package/dist/api/cashierbox/put.d.ts +4 -0
  10. package/dist/api/cashierbox/put.js +3 -10
  11. package/dist/api/companies/get.d.ts +2 -0
  12. package/dist/api/companies/get.js +3 -10
  13. package/dist/api/companies/post.d.ts +3 -0
  14. package/dist/api/companies/post.js +5 -13
  15. package/dist/api/companies/put.d.ts +4 -0
  16. package/dist/api/companies/put.js +7 -16
  17. package/dist/api/countries/get.d.ts +2 -0
  18. package/dist/api/countries/get.js +3 -10
  19. package/dist/api/countries/post.d.ts +0 -0
  20. package/dist/api/countries/put.d.ts +0 -0
  21. package/dist/api/csv/get.d.ts +11 -0
  22. package/dist/api/csv/get.js +5 -12
  23. package/dist/api/csv/index.d.ts +1 -0
  24. package/dist/api/csv/index.js +1 -27
  25. package/dist/api/customers/delete.d.ts +2 -0
  26. package/dist/api/customers/delete.js +3 -10
  27. package/dist/api/customers/get.d.ts +28 -0
  28. package/dist/api/customers/get.js +12 -22
  29. package/dist/api/customers/index.d.ts +4 -0
  30. package/dist/api/customers/index.js +4 -30
  31. package/dist/api/customers/post.d.ts +18 -0
  32. package/dist/api/customers/post.js +3 -10
  33. package/dist/api/customers/put.d.ts +18 -0
  34. package/dist/api/customers/put.js +3 -10
  35. package/dist/api/discounts/get.d.ts +6 -0
  36. package/dist/api/discounts/get.js +11 -22
  37. package/dist/api/discounts/post.d.ts +3 -0
  38. package/dist/api/discounts/post.js +5 -13
  39. package/dist/api/discounts/put.d.ts +3 -0
  40. package/dist/api/discounts/put.js +5 -13
  41. package/dist/api/index.d.ts +7 -0
  42. package/dist/api/index.js +78 -103
  43. package/dist/api/inventory/delete.d.ts +2 -0
  44. package/dist/api/inventory/delete.js +3 -10
  45. package/dist/api/inventory/get.d.ts +7 -0
  46. package/dist/api/inventory/get.js +7 -16
  47. package/dist/api/inventory/index.d.ts +4 -0
  48. package/dist/api/inventory/index.js +4 -30
  49. package/dist/api/inventory/post.d.ts +7 -0
  50. package/dist/api/inventory/post.js +3 -10
  51. package/dist/api/inventory/put.d.ts +8 -0
  52. package/dist/api/inventory/put.js +5 -13
  53. package/dist/api/products/delete.d.ts +3 -0
  54. package/dist/api/products/delete.js +5 -13
  55. package/dist/api/products/get.d.ts +2 -0
  56. package/dist/api/products/get.js +3 -10
  57. package/dist/api/products/index.d.ts +4 -0
  58. package/dist/api/products/index.js +4 -30
  59. package/dist/api/products/post.d.ts +27 -0
  60. package/dist/api/products/post.js +5 -13
  61. package/dist/api/products/put.d.ts +21 -0
  62. package/dist/api/products/put.js +5 -13
  63. package/dist/api/sections/delete.d.ts +2 -0
  64. package/dist/api/sections/delete.js +3 -10
  65. package/dist/api/sections/get.d.ts +7 -0
  66. package/dist/api/sections/get.js +5 -13
  67. package/dist/api/sections/index.d.ts +4 -0
  68. package/dist/api/sections/index.js +4 -30
  69. package/dist/api/sections/post.d.ts +7 -0
  70. package/dist/api/sections/post.js +3 -10
  71. package/dist/api/sections/put.d.ts +8 -0
  72. package/dist/api/sections/put.js +3 -10
  73. package/dist/api/staff/delete.d.ts +2 -0
  74. package/dist/api/staff/delete.js +3 -10
  75. package/dist/api/staff/get.d.ts +3 -0
  76. package/dist/api/staff/get.js +5 -13
  77. package/dist/api/staff/post.d.ts +2 -0
  78. package/dist/api/staff/post.js +3 -10
  79. package/dist/api/staff/put.d.ts +2 -0
  80. package/dist/api/staff/put.js +3 -10
  81. package/dist/api/stores/get.d.ts +12 -0
  82. package/dist/api/stores/get.js +9 -19
  83. package/dist/api/stores/post.d.ts +4 -0
  84. package/dist/api/stores/post.js +7 -16
  85. package/dist/api/stores/put.d.ts +6 -0
  86. package/dist/api/stores/put.js +5 -13
  87. package/dist/api/stripe/get.d.ts +0 -0
  88. package/dist/api/stripe/post.d.ts +6 -0
  89. package/dist/api/stripe/post.js +7 -16
  90. package/dist/api/stripe/put.d.ts +0 -0
  91. package/dist/api/supplies/delete.d.ts +2 -0
  92. package/dist/api/supplies/delete.js +3 -10
  93. package/dist/api/supplies/get.d.ts +7 -0
  94. package/dist/api/supplies/get.js +7 -16
  95. package/dist/api/supplies/post.d.ts +11 -0
  96. package/dist/api/supplies/post.js +3 -10
  97. package/dist/api/supplies/put.d.ts +6 -0
  98. package/dist/api/supplies/put.js +5 -13
  99. package/dist/api/users/put.d.ts +10 -0
  100. package/dist/api/users/put.js +3 -10
  101. package/dist/enum/index.d.ts +10 -0
  102. package/dist/enum/index.js +4 -7
  103. package/dist/index.d.ts +3 -0
  104. package/dist/index.js +3 -33
  105. package/dist/interfaces/Api.d.ts +3 -0
  106. package/dist/interfaces/Api.js +1 -2
  107. package/dist/interfaces/Company.d.ts +0 -0
  108. package/dist/interfaces/Customer.d.ts +47 -0
  109. package/dist/interfaces/Customer.js +1 -2
  110. package/dist/interfaces/Order.d.ts +91 -0
  111. package/dist/interfaces/Order.js +1 -2
  112. package/dist/interfaces/Permission.d.ts +22 -0
  113. package/dist/interfaces/Permission.js +1 -2
  114. package/dist/interfaces/Product.d.ts +51 -0
  115. package/dist/interfaces/Product.js +1 -2
  116. package/dist/interfaces/Section.d.ts +13 -0
  117. package/dist/interfaces/Section.js +1 -2
  118. package/dist/interfaces/Store.d.ts +323 -0
  119. package/dist/interfaces/Store.js +1 -2
  120. package/dist/interfaces/StoreImage.d.ts +8 -0
  121. package/dist/interfaces/StoreImage.js +1 -2
  122. package/dist/interfaces/User.d.ts +38 -0
  123. package/dist/interfaces/User.js +1 -2
  124. package/dist/utils/apiUtils.d.ts +3 -0
  125. package/dist/utils/apiUtils.js +2 -6
  126. package/dist/utils/index.d.ts +1 -0
  127. package/dist/utils/index.js +1 -17
  128. package/dist/utils/orders/calculateOrderTotal.d.ts +5 -0
  129. package/dist/utils/orders/calculateOrderTotal.js +10 -14
  130. package/dist/utils/orders/calculateTotalTaxesIncluded.d.ts +9 -0
  131. package/dist/utils/orders/calculateTotalTaxesIncluded.js +3 -7
  132. package/dist/utils/orders/calculateTotalTaxesOverPrice.d.ts +8 -0
  133. package/dist/utils/orders/calculateTotalTaxesOverPrice.js +7 -11
  134. package/dist/utils/orders/helpers.d.ts +15 -0
  135. package/dist/utils/orders/helpers.js +6 -13
  136. package/dist/utils/orders/index.d.ts +2 -0
  137. package/dist/utils/orders/index.js +2 -5
  138. package/dist/utils/receipt/generateReceiptHTML.d.ts +0 -0
  139. package/dist/utils/util.d.ts +0 -0
  140. package/package.json +2 -1
  141. package/src/api/axiosInstance.ts +1 -0
  142. package/src/api/customers/get.ts +1 -1
  143. package/src/api/index.ts +0 -10
  144. package/src/utils/apiUtils.ts +1 -1
  145. package/tsconfig.json +10 -9
@@ -0,0 +1,27 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const create: (this: WashdayClientInstance, data: {
3
+ name: string;
4
+ price: number;
5
+ expressPrice: number;
6
+ type: 'normal' | 'weight';
7
+ pieces: number;
8
+ sku?: string;
9
+ overlayText: string;
10
+ order: number;
11
+ taxExemptOne: boolean;
12
+ taxExemptTwo: boolean;
13
+ taxExemptThree: boolean;
14
+ showInApp: boolean;
15
+ image: string;
16
+ store: string;
17
+ section: string;
18
+ invoice_description: string;
19
+ invoice_product_key: string;
20
+ invoice_product_unit_key: string;
21
+ invoice_product_unit_name: string;
22
+ productSupplies: Array<any>;
23
+ }) => Promise<any>;
24
+ export declare const createProductSupply: (this: WashdayClientInstance, id: string, data: {
25
+ supplyId: string;
26
+ usageAmount: number;
27
+ }) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,21 +7,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.createProductSupply = exports.create = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_PRODUCTS_SUPPLY = 'api/product-supply';
18
12
  const GET_SET_PRODUCTS = 'api/product';
19
- const create = function (data) {
13
+ export const create = function (data) {
20
14
  return __awaiter(this, void 0, void 0, function* () {
21
15
  try {
22
16
  const config = {
23
17
  headers: { Authorization: `Bearer ${this.apiToken}` }
24
18
  };
25
- const response = yield axiosInstance_1.default.post(`${GET_SET_PRODUCTS}`, data, config);
19
+ const response = yield axiosInstance.post(`${GET_SET_PRODUCTS}`, data, config);
26
20
  return response;
27
21
  }
28
22
  catch (error) {
@@ -31,14 +25,13 @@ const create = function (data) {
31
25
  }
32
26
  });
33
27
  };
34
- exports.create = create;
35
- const createProductSupply = function (id, data) {
28
+ export const createProductSupply = function (id, data) {
36
29
  return __awaiter(this, void 0, void 0, function* () {
37
30
  try {
38
31
  const config = {
39
32
  headers: { Authorization: `Bearer ${this.apiToken}` }
40
33
  };
41
- const response = yield axiosInstance_1.default.post(`${GET_SET_PRODUCTS_SUPPLY}/${id}`, data, config);
34
+ const response = yield axiosInstance.post(`${GET_SET_PRODUCTS_SUPPLY}/${id}`, data, config);
42
35
  return response;
43
36
  }
44
37
  catch (error) {
@@ -47,4 +40,3 @@ const createProductSupply = function (id, data) {
47
40
  }
48
41
  });
49
42
  };
50
- exports.createProductSupply = createProductSupply;
@@ -0,0 +1,21 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const bulkUpdate: (this: WashdayClientInstance, storeId: string, data: any) => Promise<any>;
3
+ export declare const updateById: (this: WashdayClientInstance, id: string, data: {
4
+ name?: string;
5
+ price?: number;
6
+ expressPrice?: number;
7
+ type?: 'normal' | 'weight';
8
+ pieces?: number;
9
+ sku?: string;
10
+ overlayText?: string;
11
+ order?: number;
12
+ taxExemptOne?: boolean;
13
+ taxExemptTwo?: boolean;
14
+ taxExemptThree?: boolean;
15
+ showInApp?: boolean;
16
+ image?: string;
17
+ invoice_product_key?: string;
18
+ invoice_description?: string;
19
+ invoice_product_unit_key?: string;
20
+ invoice_product_unit_name?: string;
21
+ }) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.updateById = exports.bulkUpdate = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_PRODUCTS = 'api/product';
18
- const bulkUpdate = function (storeId, data) {
12
+ export const bulkUpdate = function (storeId, data) {
19
13
  return __awaiter(this, void 0, void 0, function* () {
20
14
  try {
21
15
  const config = {
22
16
  headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
23
17
  };
24
- const response = yield axiosInstance_1.default.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
18
+ const response = yield axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
25
19
  return response.data || {};
26
20
  }
27
21
  catch (error) {
@@ -30,14 +24,13 @@ const bulkUpdate = function (storeId, data) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.bulkUpdate = bulkUpdate;
34
- const updateById = function (id, data) {
27
+ export const updateById = function (id, data) {
35
28
  return __awaiter(this, void 0, void 0, function* () {
36
29
  try {
37
30
  const config = {
38
31
  headers: { Authorization: `Bearer ${this.apiToken}` }
39
32
  };
40
- return yield axiosInstance_1.default.put(`${GET_SET_PRODUCTS}/${id}`, data, config);
33
+ return yield axiosInstance.put(`${GET_SET_PRODUCTS}/${id}`, data, config);
41
34
  }
42
35
  catch (error) {
43
36
  console.error('Error fetching updateById:', error);
@@ -45,4 +38,3 @@ const updateById = function (id, data) {
45
38
  }
46
39
  });
47
40
  };
48
- exports.updateById = updateById;
@@ -0,0 +1,2 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const deleteById: (this: WashdayClientInstance, id: string) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.deleteById = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_SECTIONS = 'api/section';
18
- const deleteById = function (id) {
12
+ export const deleteById = function (id) {
19
13
  return __awaiter(this, void 0, void 0, function* () {
20
14
  try {
21
15
  const config = {
22
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
23
17
  };
24
- return yield axiosInstance_1.default.delete(`${GET_SET_SECTIONS}/${id}`, config);
18
+ return yield axiosInstance.delete(`${GET_SET_SECTIONS}/${id}`, config);
25
19
  }
26
20
  catch (error) {
27
21
  console.error('Error fetching deleteById:', error);
@@ -29,4 +23,3 @@ const deleteById = function (id) {
29
23
  }
30
24
  });
31
25
  };
32
- exports.deleteById = deleteById;
@@ -0,0 +1,7 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const getList: (this: WashdayClientInstance, params?: {
3
+ storeId?: string;
4
+ isActive?: string;
5
+ products?: boolean;
6
+ }) => Promise<any>;
7
+ export declare const getById: (this: WashdayClientInstance, id: string) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,14 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.getById = exports.getList = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_SECTIONS = 'api/section';
18
- const getList = function (params) {
12
+ export const getList = function (params) {
19
13
  return __awaiter(this, void 0, void 0, function* () {
20
14
  try {
21
15
  const config = {
@@ -34,7 +28,7 @@ const getList = function (params) {
34
28
  if (params === null || params === void 0 ? void 0 : params.hasOwnProperty('products')) {
35
29
  queryParams += `&products=${params === null || params === void 0 ? void 0 : params.products}`;
36
30
  }
37
- return yield axiosInstance_1.default.get(`${GET_SET_SECTIONS}?${queryParams}`, config);
31
+ return yield axiosInstance.get(`${GET_SET_SECTIONS}?${queryParams}`, config);
38
32
  }
39
33
  catch (error) {
40
34
  console.error('Error fetching getStoreStaff:', error);
@@ -42,14 +36,13 @@ const getList = function (params) {
42
36
  }
43
37
  });
44
38
  };
45
- exports.getList = getList;
46
- const getById = function (id) {
39
+ export const getById = function (id) {
47
40
  return __awaiter(this, void 0, void 0, function* () {
48
41
  try {
49
42
  const config = {
50
43
  headers: { Authorization: `Bearer ${this.apiToken}` }
51
44
  };
52
- return yield axiosInstance_1.default.get(`${GET_SET_SECTIONS}/${id}`, config);
45
+ return yield axiosInstance.get(`${GET_SET_SECTIONS}/${id}`, config);
53
46
  }
54
47
  catch (error) {
55
48
  console.error('Error fetching getSectionById:', error);
@@ -57,4 +50,3 @@ const getById = function (id) {
57
50
  }
58
51
  });
59
52
  };
60
- exports.getById = getById;
@@ -0,0 +1,4 @@
1
+ export * as deleteModule from './delete';
2
+ export * as getModule from './get';
3
+ export * as postModule from './post';
4
+ export * as putModule from './put';
@@ -1,30 +1,4 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.putModule = exports.postModule = exports.getModule = exports.deleteModule = void 0;
27
- exports.deleteModule = __importStar(require("./delete"));
28
- exports.getModule = __importStar(require("./get"));
29
- exports.postModule = __importStar(require("./post"));
30
- exports.putModule = __importStar(require("./put"));
1
+ export * as deleteModule from './delete';
2
+ export * as getModule from './get';
3
+ export * as postModule from './post';
4
+ export * as putModule from './put';
@@ -0,0 +1,7 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const create: (this: WashdayClientInstance, data: {
3
+ name: string;
4
+ order: number;
5
+ boxColor: string;
6
+ store: string;
7
+ }) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.create = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_SECTIONS = 'api/section';
18
- const create = function (data) {
12
+ export const create = function (data) {
19
13
  return __awaiter(this, void 0, void 0, function* () {
20
14
  try {
21
15
  const config = {
22
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
23
17
  };
24
- const response = yield axiosInstance_1.default.post(`${GET_SET_SECTIONS}`, data, config);
18
+ const response = yield axiosInstance.post(`${GET_SET_SECTIONS}`, data, config);
25
19
  return response;
26
20
  }
27
21
  catch (error) {
@@ -30,4 +24,3 @@ const create = function (data) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.create = create;
@@ -0,0 +1,8 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const updateById: (this: WashdayClientInstance, id: string, data: {
3
+ name?: string;
4
+ order?: number;
5
+ boxColor?: string;
6
+ showInApp?: boolean;
7
+ product?: any;
8
+ }) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.updateById = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_SECTIONS = 'api/section';
18
- const updateById = function (id, data) {
12
+ export const updateById = function (id, data) {
19
13
  return __awaiter(this, void 0, void 0, function* () {
20
14
  try {
21
15
  const config = {
22
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
23
17
  };
24
- return yield axiosInstance_1.default.put(`${GET_SET_SECTIONS}/${id}`, data, config);
18
+ return yield axiosInstance.put(`${GET_SET_SECTIONS}/${id}`, data, config);
25
19
  }
26
20
  catch (error) {
27
21
  console.error('Error fetching updateById:', error);
@@ -29,4 +23,3 @@ const updateById = function (id, data) {
29
23
  }
30
24
  });
31
25
  };
32
- exports.updateById = updateById;
@@ -0,0 +1,2 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const deleteStoreStaffById: (this: WashdayClientInstance, storeId: string, staffId: string) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.deleteStoreStaffById = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_STAFF = (storeId) => `api/store/${storeId}/staff`;
18
- const deleteStoreStaffById = function (storeId, staffId) {
12
+ export const deleteStoreStaffById = function (storeId, staffId) {
19
13
  return __awaiter(this, void 0, void 0, function* () {
20
14
  try {
21
15
  const config = {
22
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
23
17
  };
24
- const response = yield axiosInstance_1.default.delete(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
18
+ const response = yield axiosInstance.delete(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
25
19
  return response;
26
20
  }
27
21
  catch (error) {
@@ -30,4 +24,3 @@ const deleteStoreStaffById = function (storeId, staffId) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.deleteStoreStaffById = deleteStoreStaffById;
@@ -0,0 +1,3 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const getStoreStaff: (this: WashdayClientInstance, storeId: string, queryParams?: string) => Promise<any>;
3
+ export declare const getStoreStaffById: (this: WashdayClientInstance, storeId: string, staffId: string) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.getStoreStaffById = exports.getStoreStaff = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_STAFF = (storeId) => `api/store/${storeId}/staff`;
18
- const getStoreStaff = function (storeId, queryParams) {
12
+ export const getStoreStaff = function (storeId, queryParams) {
19
13
  return __awaiter(this, void 0, void 0, function* () {
20
14
  try {
21
15
  const config = {
22
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
23
17
  };
24
- const response = yield axiosInstance_1.default.get(`${GET_SET_STAFF(storeId)}?${queryParams}`, config);
18
+ const response = yield axiosInstance.get(`${GET_SET_STAFF(storeId)}?${queryParams}`, config);
25
19
  return response;
26
20
  }
27
21
  catch (error) {
@@ -30,14 +24,13 @@ const getStoreStaff = function (storeId, queryParams) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.getStoreStaff = getStoreStaff;
34
- const getStoreStaffById = function (storeId, staffId) {
27
+ export const getStoreStaffById = function (storeId, staffId) {
35
28
  return __awaiter(this, void 0, void 0, function* () {
36
29
  try {
37
30
  const config = {
38
31
  headers: { Authorization: `Bearer ${this.apiToken}` }
39
32
  };
40
- return yield axiosInstance_1.default.get(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
33
+ return yield axiosInstance.get(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
41
34
  }
42
35
  catch (error) {
43
36
  console.error('Error fetching getStoreStaffById:', error);
@@ -45,4 +38,3 @@ const getStoreStaffById = function (storeId, staffId) {
45
38
  }
46
39
  });
47
40
  };
48
- exports.getStoreStaffById = getStoreStaffById;
@@ -0,0 +1,2 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const createStoreStaff: (this: WashdayClientInstance, storeId: string, data: any) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.createStoreStaff = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_STAFF = (storeId) => `api/store/${storeId}/staff`;
18
- const createStoreStaff = function (storeId, data) {
12
+ export const createStoreStaff = function (storeId, data) {
19
13
  return __awaiter(this, void 0, void 0, function* () {
20
14
  try {
21
15
  const config = {
22
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
23
17
  };
24
- const response = yield axiosInstance_1.default.post(`${GET_SET_STAFF(storeId)}`, data, config);
18
+ const response = yield axiosInstance.post(`${GET_SET_STAFF(storeId)}`, data, config);
25
19
  return response;
26
20
  }
27
21
  catch (error) {
@@ -30,4 +24,3 @@ const createStoreStaff = function (storeId, data) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.createStoreStaff = createStoreStaff;
@@ -0,0 +1,2 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const updateStoreStaffById: (this: WashdayClientInstance, storeId: string, staffId: string, data: any) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,20 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.updateStoreStaffById = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_STAFF = (storeId) => `api/store/${storeId}/staff`;
18
- const updateStoreStaffById = function (storeId, staffId, data) {
12
+ export const updateStoreStaffById = function (storeId, staffId, data) {
19
13
  return __awaiter(this, void 0, void 0, function* () {
20
14
  try {
21
15
  const config = {
22
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
23
17
  };
24
- const response = yield axiosInstance_1.default.put(`${GET_SET_STAFF(storeId)}/${staffId}`, data, config);
18
+ const response = yield axiosInstance.put(`${GET_SET_STAFF(storeId)}/${staffId}`, data, config);
25
19
  return response;
26
20
  }
27
21
  catch (error) {
@@ -30,4 +24,3 @@ const updateStoreStaffById = function (storeId, staffId, data) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.updateStoreStaffById = updateStoreStaffById;
@@ -0,0 +1,12 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import { IStore } from "../../interfaces/Store";
3
+ export declare const getStores: (this: WashdayClientInstance, params: {
4
+ isActive?: string;
5
+ }) => Promise<{
6
+ stores: IStore[];
7
+ }>;
8
+ export declare const getStoreReviewLink: (this: WashdayClientInstance, storeId: string) => Promise<any>;
9
+ export declare const getStoreById: (this: WashdayClientInstance, storeId: string) => Promise<{
10
+ store: IStore;
11
+ }>;
12
+ export declare const getStoreImages: (this: WashdayClientInstance, storeId: string) => Promise<any>;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,18 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
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.getStoreImages = exports.getStoreById = exports.getStoreReviewLink = exports.getStores = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_STORES = 'api/store';
18
12
  const GET_SET_STORE_IMAGE = 'api/store-image';
19
13
  const REQUEST_PARAMS = {
20
14
  token: 'LOGGED_USER_TOKEN',
21
15
  };
22
- const getStores = function (params) {
16
+ export const getStores = function (params) {
23
17
  return __awaiter(this, void 0, void 0, function* () {
24
18
  var _a, _b;
25
19
  try {
@@ -28,7 +22,7 @@ const getStores = function (params) {
28
22
  if (params.isActive) {
29
23
  queryParams += `isActive=${params.isActive}`;
30
24
  }
31
- const response = yield axiosInstance_1.default.get(`${GET_SET_STORES}?${queryParams}`, { params: Object.assign({}, REQUEST_PARAMS) });
25
+ const response = yield axiosInstance.get(`${GET_SET_STORES}?${queryParams}`, { params: Object.assign({}, REQUEST_PARAMS) });
32
26
  return ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.stores) || [];
33
27
  }
34
28
  catch (error) {
@@ -37,14 +31,13 @@ const getStores = function (params) {
37
31
  }
38
32
  });
39
33
  };
40
- exports.getStores = getStores;
41
- const getStoreReviewLink = function (storeId) {
34
+ export const getStoreReviewLink = function (storeId) {
42
35
  return __awaiter(this, void 0, void 0, function* () {
43
36
  try {
44
37
  const config = {
45
38
  headers: { Authorization: `Bearer ${this.apiToken}` }
46
39
  };
47
- const response = yield axiosInstance_1.default.get(`${GET_SET_STORES}/review-link/${storeId}`, config);
40
+ const response = yield axiosInstance.get(`${GET_SET_STORES}/review-link/${storeId}`, config);
48
41
  return response;
49
42
  }
50
43
  catch (error) {
@@ -53,13 +46,12 @@ const getStoreReviewLink = function (storeId) {
53
46
  }
54
47
  });
55
48
  };
56
- exports.getStoreReviewLink = getStoreReviewLink;
57
- const getStoreById = function (storeId) {
49
+ export const getStoreById = function (storeId) {
58
50
  return __awaiter(this, void 0, void 0, function* () {
59
51
  var _a;
60
52
  try {
61
53
  REQUEST_PARAMS.token = this.apiToken;
62
- const response = yield axiosInstance_1.default.get(`${GET_SET_STORES}/${storeId}`, { params: Object.assign({}, REQUEST_PARAMS) });
54
+ const response = yield axiosInstance.get(`${GET_SET_STORES}/${storeId}`, { params: Object.assign({}, REQUEST_PARAMS) });
63
55
  return ((_a = response.data) === null || _a === void 0 ? void 0 : _a.data) || {};
64
56
  }
65
57
  catch (error) {
@@ -68,14 +60,13 @@ const getStoreById = function (storeId) {
68
60
  }
69
61
  });
70
62
  };
71
- exports.getStoreById = getStoreById;
72
- const getStoreImages = function (storeId) {
63
+ export const getStoreImages = function (storeId) {
73
64
  return __awaiter(this, void 0, void 0, function* () {
74
65
  try {
75
66
  const config = {
76
67
  headers: { Authorization: `Bearer ${this.apiToken}` }
77
68
  };
78
- const response = yield axiosInstance_1.default.get(`${GET_SET_STORE_IMAGE}?store=${storeId}`, config);
69
+ const response = yield axiosInstance.get(`${GET_SET_STORE_IMAGE}?store=${storeId}`, config);
79
70
  return response;
80
71
  }
81
72
  catch (error) {
@@ -84,4 +75,3 @@ const getStoreImages = function (storeId) {
84
75
  }
85
76
  });
86
77
  };
87
- exports.getStoreImages = getStoreImages;