washday-sdk 0.0.70 → 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 -21
  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 +3 -2
  143. package/src/api/index.ts +0 -10
  144. package/src/utils/apiUtils.ts +1 -1
  145. package/tsconfig.json +10 -9
package/dist/api/index.js CHANGED
@@ -1,57 +1,32 @@
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
- const delete_1 = require("./cashierbox/delete");
27
- const get_1 = require("./cashierbox/get");
28
- const post_1 = require("./cashierbox/post");
29
- const put_1 = require("./cashierbox/put");
30
- const get_2 = require("./companies/get");
31
- const post_2 = require("./companies/post");
32
- const put_2 = require("./companies/put");
33
- const get_3 = require("./countries/get");
34
- const get_4 = require("./discounts/get");
35
- const post_3 = require("./discounts/post");
36
- const put_3 = require("./discounts/put");
37
- const delete_2 = require("./staff/delete");
38
- const get_5 = require("./staff/get");
39
- const post_4 = require("./staff/post");
40
- const put_4 = require("./staff/put");
41
- const get_6 = require("./stores/get");
42
- const post_5 = require("./stores/post");
43
- const put_5 = require("./stores/put");
44
- const post_6 = require("./stripe/post");
45
- const delete_3 = require("./supplies/delete");
46
- const get_7 = require("./supplies/get");
47
- const post_7 = require("./supplies/post");
48
- const put_6 = require("./supplies/put");
49
- const put_7 = require("./users/put");
50
- const inventoryEndpoints = __importStar(require("./inventory"));
51
- const sectionsEndpoints = __importStar(require("./sections"));
52
- const productsEndpoints = __importStar(require("./products"));
53
- const customersEndpoints = __importStar(require("./customers"));
54
- const csvExportEndpoints = __importStar(require("./csv"));
1
+ import { deleteCashierBoxById } from "./cashierbox/delete";
2
+ import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "./cashierbox/get";
3
+ import { addCashierBoxMovement, createCashierBox } from "./cashierbox/post";
4
+ import { updateCashierBoxById } from "./cashierbox/put";
5
+ import { getCompanyById } from "./companies/get";
6
+ import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
7
+ import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
8
+ import { getCountries } from "./countries/get";
9
+ import { getAutomaticDiscountById, getAutomaticDiscounts, getDiscountCodeById, getDiscountCodes, verifyDiscountCode } from './discounts/get';
10
+ import { createAutomaticDiscount, createDiscountCode } from "./discounts/post";
11
+ import { deleteAutomaticDiscountById, deleteDiscountCodeById } from "./discounts/put";
12
+ import { deleteStoreStaffById } from "./staff/delete";
13
+ import { getStoreStaff, getStoreStaffById } from "./staff/get";
14
+ import { createStoreStaff } from "./staff/post";
15
+ import { updateStoreStaffById } from "./staff/put";
16
+ import { getStoreById, getStoreImages, getStoreReviewLink, getStores } from "./stores/get";
17
+ import { copyStore, createStore, createStoreImage } from "./stores/post";
18
+ import { deleteStoreById, updateStoreById } from "./stores/put";
19
+ import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession } from "./stripe/post";
20
+ import { deleteSupplyById } from "./supplies/delete";
21
+ import { getSupplies, getSupplyById, getSupplyHistory } from "./supplies/get";
22
+ import { createSupply } from "./supplies/post";
23
+ import { addSupplyStock, updateSupplyById } from "./supplies/put";
24
+ import { updateUserById } from "./users/put";
25
+ import * as inventoryEndpoints from './inventory';
26
+ import * as sectionsEndpoints from './sections';
27
+ import * as productsEndpoints from './products';
28
+ import * as customersEndpoints from './customers';
29
+ import * as csvExportEndpoints from './csv';
55
30
  const WashdayClient = function WashdayClient(apiToken) {
56
31
  this.apiToken = apiToken;
57
32
  WashdayClient.prototype.customers.apiToken = apiToken;
@@ -80,15 +55,15 @@ WashdayClient.prototype.customers = {
80
55
  deleteById: customersEndpoints.deleteModule.deleteById,
81
56
  };
82
57
  WashdayClient.prototype.stores = {
83
- getStores: get_6.getStores,
84
- getStoreById: get_6.getStoreById,
85
- getStoreImages: get_6.getStoreImages,
86
- createStore: post_5.createStore,
87
- copyStore: post_5.copyStore,
88
- updateStoreById: put_5.updateStoreById,
89
- createStoreImage: post_5.createStoreImage,
90
- getStoreReviewLink: get_6.getStoreReviewLink,
91
- deleteStoreById: put_5.deleteStoreById,
58
+ getStores: getStores,
59
+ getStoreById: getStoreById,
60
+ getStoreImages: getStoreImages,
61
+ createStore: createStore,
62
+ copyStore: copyStore,
63
+ updateStoreById: updateStoreById,
64
+ createStoreImage: createStoreImage,
65
+ getStoreReviewLink: getStoreReviewLink,
66
+ deleteStoreById: deleteStoreById,
92
67
  };
93
68
  WashdayClient.prototype.products = {
94
69
  getById: productsEndpoints.getModule.getById,
@@ -100,19 +75,19 @@ WashdayClient.prototype.products = {
100
75
  bulkUpdate: productsEndpoints.putModule.bulkUpdate
101
76
  };
102
77
  WashdayClient.prototype.users = {
103
- updateUserById: put_7.updateUserById,
78
+ updateUserById: updateUserById,
104
79
  };
105
80
  WashdayClient.prototype.countries = {
106
- getCountries: get_3.getCountries,
81
+ getCountries: getCountries,
107
82
  };
108
83
  WashdayClient.prototype.supplies = {
109
- getSupplies: get_7.getSupplies,
110
- getSupplyById: get_7.getSupplyById,
111
- getSupplyHistory: get_7.getSupplyHistory,
112
- createSupply: post_7.createSupply,
113
- updateSupplyById: put_6.updateSupplyById,
114
- addSupplyStock: put_6.addSupplyStock,
115
- deleteSupplyById: delete_3.deleteSupplyById,
84
+ getSupplies: getSupplies,
85
+ getSupplyById: getSupplyById,
86
+ getSupplyHistory: getSupplyHistory,
87
+ createSupply: createSupply,
88
+ updateSupplyById: updateSupplyById,
89
+ addSupplyStock: addSupplyStock,
90
+ deleteSupplyById: deleteSupplyById,
116
91
  };
117
92
  WashdayClient.prototype.sections = {
118
93
  getSections: sectionsEndpoints.getModule.getList,
@@ -131,48 +106,48 @@ WashdayClient.prototype.inventory = {
131
106
  addStock: inventoryEndpoints.putModule.addStock,
132
107
  };
133
108
  WashdayClient.prototype.cashierboxes = {
134
- getCashierboxesByStoreId: get_1.getCashierboxesByStoreId,
135
- getCashierboxesById: get_1.getCashierboxesById,
136
- getCashierBoxMovementsHistory: get_1.getCashierBoxMovementsHistory,
137
- createCashierBox: post_1.createCashierBox,
138
- updateCashierBoxById: put_1.updateCashierBoxById,
139
- deleteCashierBoxById: delete_1.deleteCashierBoxById,
140
- addCashierBoxMovement: post_1.addCashierBoxMovement,
109
+ getCashierboxesByStoreId: getCashierboxesByStoreId,
110
+ getCashierboxesById: getCashierboxesById,
111
+ getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
112
+ createCashierBox: createCashierBox,
113
+ updateCashierBoxById: updateCashierBoxById,
114
+ deleteCashierBoxById: deleteCashierBoxById,
115
+ addCashierBoxMovement: addCashierBoxMovement,
141
116
  };
142
117
  WashdayClient.prototype.companies = {
143
- getCompanyById: get_2.getCompanyById,
144
- updateCompanyById: put_2.updateCompanyById,
145
- updateCompanyLogoById: put_2.updateCompanyLogoById,
146
- updateCompanyTaxInfoById: put_2.updateCompanyTaxInfoById,
147
- updateCompanyTaxInfoCertificates: post_2.updateCompanyTaxInfoCertificates,
148
- updateCFDIOrgLogo: post_2.updateCFDIOrgLogo
118
+ getCompanyById: getCompanyById,
119
+ updateCompanyById: updateCompanyById,
120
+ updateCompanyLogoById: updateCompanyLogoById,
121
+ updateCompanyTaxInfoById: updateCompanyTaxInfoById,
122
+ updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
123
+ updateCFDIOrgLogo: updateCFDIOrgLogo
149
124
  };
150
125
  WashdayClient.prototype.stripe = {
151
- createCreateSuscriptionCheckoutSession: post_6.createCreateSuscriptionCheckoutSession,
152
- createCFDISuscrptionCheckoutSession: post_6.createCFDISuscrptionCheckoutSession,
153
- createCustomerPortalSession: post_6.createCustomerPortalSession
126
+ createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
127
+ createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
128
+ createCustomerPortalSession: createCustomerPortalSession
154
129
  };
155
130
  WashdayClient.prototype.staff = {
156
- getStoreStaff: get_5.getStoreStaff,
157
- getStoreStaffById: get_5.getStoreStaffById,
158
- updateStoreStaffById: put_4.updateStoreStaffById,
159
- createStoreStaff: post_4.createStoreStaff,
160
- deleteStoreStaffById: delete_2.deleteStoreStaffById,
131
+ getStoreStaff: getStoreStaff,
132
+ getStoreStaffById: getStoreStaffById,
133
+ updateStoreStaffById: updateStoreStaffById,
134
+ createStoreStaff: createStoreStaff,
135
+ deleteStoreStaffById: deleteStoreStaffById,
161
136
  };
162
137
  WashdayClient.prototype.discountCodes = {
163
- getDiscountCodes: get_4.getDiscountCodes,
164
- getDiscountCodeById: get_4.getDiscountCodeById,
165
- verifyDiscountCode: get_4.verifyDiscountCode,
166
- createDiscountCode: post_3.createDiscountCode,
167
- deleteDiscountCodeById: put_3.deleteDiscountCodeById,
138
+ getDiscountCodes: getDiscountCodes,
139
+ getDiscountCodeById: getDiscountCodeById,
140
+ verifyDiscountCode: verifyDiscountCode,
141
+ createDiscountCode: createDiscountCode,
142
+ deleteDiscountCodeById: deleteDiscountCodeById,
168
143
  };
169
144
  WashdayClient.prototype.automaticDiscount = {
170
- getAutomaticDiscounts: get_4.getAutomaticDiscounts,
171
- getAutomaticDiscountById: get_4.getAutomaticDiscountById,
172
- createAutomaticDiscount: post_3.createAutomaticDiscount,
173
- deleteAutomaticDiscountById: put_3.deleteAutomaticDiscountById,
145
+ getAutomaticDiscounts: getAutomaticDiscounts,
146
+ getAutomaticDiscountById: getAutomaticDiscountById,
147
+ createAutomaticDiscount: createAutomaticDiscount,
148
+ deleteAutomaticDiscountById: deleteAutomaticDiscountById,
174
149
  };
175
150
  WashdayClient.prototype.csv = {
176
151
  exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
177
152
  };
178
- exports.default = WashdayClient;
153
+ export default WashdayClient;
@@ -0,0 +1,2 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const deleteById: (this: WashdayClientInstance, storeId: string, 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_INVENTORY = (storeId) => `api/store/${storeId}/inventory`;
18
- const deleteById = function (storeId, id) {
12
+ export const deleteById = function (storeId, 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
- const response = yield axiosInstance_1.default.delete(`${GET_SET_INVENTORY(storeId)}/${id}`, config);
18
+ const response = yield axiosInstance.delete(`${GET_SET_INVENTORY(storeId)}/${id}`, config);
25
19
  return response;
26
20
  }
27
21
  catch (error) {
@@ -30,4 +24,3 @@ const deleteById = function (storeId, id) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.deleteById = deleteById;
@@ -0,0 +1,7 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const getInventory: (this: WashdayClientInstance, storeId: string, queryParams?: string) => Promise<any>;
3
+ export declare const getInventoryById: (this: WashdayClientInstance, storeId: string, id: string) => Promise<any>;
4
+ export declare const getHistoryById: (this: WashdayClientInstance, storeId: string, id: string, params?: {
5
+ pageNum: number;
6
+ limit: number;
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.getHistoryById = exports.getInventoryById = exports.getInventory = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_INVENTORY = (storeId) => `api/store/${storeId}/inventory`;
18
- const getInventory = function (storeId, queryParams) {
12
+ export const getInventory = 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_INVENTORY(storeId)}?${queryParams}`, config);
18
+ const response = yield axiosInstance.get(`${GET_SET_INVENTORY(storeId)}?${queryParams}`, config);
25
19
  return response;
26
20
  }
27
21
  catch (error) {
@@ -30,14 +24,13 @@ const getInventory = function (storeId, queryParams) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.getInventory = getInventory;
34
- const getInventoryById = function (storeId, id) {
27
+ export const getInventoryById = function (storeId, id) {
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_INVENTORY(storeId)}/${id}`, config);
33
+ return yield axiosInstance.get(`${GET_SET_INVENTORY(storeId)}/${id}`, config);
41
34
  }
42
35
  catch (error) {
43
36
  console.error('Error fetching getInventoryById:', error);
@@ -45,8 +38,7 @@ const getInventoryById = function (storeId, id) {
45
38
  }
46
39
  });
47
40
  };
48
- exports.getInventoryById = getInventoryById;
49
- const getHistoryById = function (storeId, id, params) {
41
+ export const getHistoryById = function (storeId, id, params) {
50
42
  return __awaiter(this, void 0, void 0, function* () {
51
43
  try {
52
44
  const config = {
@@ -59,7 +51,7 @@ const getHistoryById = function (storeId, id, params) {
59
51
  if (params === null || params === void 0 ? void 0 : params.hasOwnProperty('limit')) {
60
52
  queryParams += `&limit=${params === null || params === void 0 ? void 0 : params.limit}`;
61
53
  }
62
- const response = yield axiosInstance_1.default.get(`${GET_SET_INVENTORY(storeId)}/${id}/history?${queryParams}`, config);
54
+ const response = yield axiosInstance.get(`${GET_SET_INVENTORY(storeId)}/${id}/history?${queryParams}`, config);
63
55
  return response;
64
56
  }
65
57
  catch (error) {
@@ -68,4 +60,3 @@ const getHistoryById = function (storeId, id, params) {
68
60
  }
69
61
  });
70
62
  };
71
- exports.getHistoryById = getHistoryById;
@@ -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, storeId: string, data: {
3
+ product: string;
4
+ stock: number;
5
+ alertOnStock: number;
6
+ stockActivityHistory: Array<any>;
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_INVENTORY = (storeId) => `api/store/${storeId}/inventory`;
18
- const create = function (storeId, data) {
12
+ export const create = 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_INVENTORY(storeId)}`, data, config);
18
+ const response = yield axiosInstance.post(`${GET_SET_INVENTORY(storeId)}`, data, config);
25
19
  return response;
26
20
  }
27
21
  catch (error) {
@@ -30,4 +24,3 @@ const create = function (storeId, 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, storeId: string, id: string, data: {
3
+ alertOnStock: number;
4
+ }) => Promise<any>;
5
+ export declare const addStock: (this: WashdayClientInstance, storeId: string, id: string, data: {
6
+ newStock: number;
7
+ date: string;
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.addStock = exports.updateById = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_INVENTORY = (storeId) => `api/store/${storeId}/inventory`;
18
- const updateById = function (storeId, id, data) {
12
+ export const updateById = function (storeId, 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
- const response = yield axiosInstance_1.default.put(`${GET_SET_INVENTORY(storeId)}/${id}`, data, config);
18
+ const response = yield axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}`, data, config);
25
19
  return response;
26
20
  }
27
21
  catch (error) {
@@ -30,14 +24,13 @@ const updateById = function (storeId, id, data) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.updateById = updateById;
34
- const addStock = function (storeId, id, data) {
27
+ export const addStock = function (storeId, 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
- const response = yield axiosInstance_1.default.put(`${GET_SET_INVENTORY(storeId)}/${id}/add-stock`, data, config);
33
+ const response = yield axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}/add-stock`, data, config);
41
34
  return response;
42
35
  }
43
36
  catch (error) {
@@ -46,4 +39,3 @@ const addStock = function (storeId, id, data) {
46
39
  }
47
40
  });
48
41
  };
49
- exports.addStock = addStock;
@@ -0,0 +1,3 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ export declare const deleteById: (this: WashdayClientInstance, id: string) => Promise<any>;
3
+ export declare const deleteProductSupplyById: (this: WashdayClientInstance, id: string, productSupplyId: 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,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.deleteProductSupplyById = exports.deleteById = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_PRODUCTS = 'api/product';
18
12
  const GET_SET_PRODUCTS_SUPPLY = 'api/product-supply';
19
- const deleteById = function (id) {
13
+ export const deleteById = function (id) {
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
- return yield axiosInstance_1.default.delete(`${GET_SET_PRODUCTS}/${id}`, config);
19
+ return yield axiosInstance.delete(`${GET_SET_PRODUCTS}/${id}`, config);
26
20
  }
27
21
  catch (error) {
28
22
  console.error('Error fetching deleteById:', error);
@@ -30,14 +24,13 @@ const deleteById = function (id) {
30
24
  }
31
25
  });
32
26
  };
33
- exports.deleteById = deleteById;
34
- const deleteProductSupplyById = function (id, productSupplyId) {
27
+ export const deleteProductSupplyById = function (id, productSupplyId) {
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.delete(`${GET_SET_PRODUCTS_SUPPLY}/${id}/${productSupplyId}`, config);
33
+ return yield axiosInstance.delete(`${GET_SET_PRODUCTS_SUPPLY}/${id}/${productSupplyId}`, config);
41
34
  }
42
35
  catch (error) {
43
36
  console.error('Error fetching deleteProductSupplyById:', error);
@@ -45,4 +38,3 @@ const deleteProductSupplyById = function (id, productSupplyId) {
45
38
  }
46
39
  });
47
40
  };
48
- exports.deleteProductSupplyById = deleteProductSupplyById;
@@ -0,0 +1,2 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ 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,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.getById = void 0;
16
- const axiosInstance_1 = __importDefault(require("../axiosInstance"));
10
+ import axiosInstance from "../axiosInstance";
17
11
  const GET_SET_PRODUCTS = 'api/product';
18
- const getById = function (id) {
12
+ export const getById = 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.get(`${GET_SET_PRODUCTS}/${id}`, config);
18
+ return yield axiosInstance.get(`${GET_SET_PRODUCTS}/${id}`, config);
25
19
  }
26
20
  catch (error) {
27
21
  console.error('Error fetching getById:', error);
@@ -29,4 +23,3 @@ const getById = function (id) {
29
23
  }
30
24
  });
31
25
  };
32
- 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';