washday-sdk 0.0.71 → 0.0.73

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 (155) 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 +88 -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/order/delete.js +25 -0
  54. package/dist/api/order/get.js +58 -0
  55. package/dist/api/order/index.js +4 -0
  56. package/dist/api/order/post.js +26 -0
  57. package/dist/api/order/put.js +40 -0
  58. package/dist/api/products/delete.d.ts +3 -0
  59. package/dist/api/products/delete.js +5 -13
  60. package/dist/api/products/get.d.ts +2 -0
  61. package/dist/api/products/get.js +3 -10
  62. package/dist/api/products/index.d.ts +4 -0
  63. package/dist/api/products/index.js +4 -30
  64. package/dist/api/products/post.d.ts +27 -0
  65. package/dist/api/products/post.js +5 -13
  66. package/dist/api/products/put.d.ts +21 -0
  67. package/dist/api/products/put.js +5 -13
  68. package/dist/api/sections/delete.d.ts +2 -0
  69. package/dist/api/sections/delete.js +3 -10
  70. package/dist/api/sections/get.d.ts +7 -0
  71. package/dist/api/sections/get.js +5 -13
  72. package/dist/api/sections/index.d.ts +4 -0
  73. package/dist/api/sections/index.js +4 -30
  74. package/dist/api/sections/post.d.ts +7 -0
  75. package/dist/api/sections/post.js +3 -10
  76. package/dist/api/sections/put.d.ts +8 -0
  77. package/dist/api/sections/put.js +3 -10
  78. package/dist/api/staff/delete.d.ts +2 -0
  79. package/dist/api/staff/delete.js +3 -10
  80. package/dist/api/staff/get.d.ts +3 -0
  81. package/dist/api/staff/get.js +5 -13
  82. package/dist/api/staff/post.d.ts +2 -0
  83. package/dist/api/staff/post.js +3 -10
  84. package/dist/api/staff/put.d.ts +2 -0
  85. package/dist/api/staff/put.js +3 -10
  86. package/dist/api/stores/get.d.ts +12 -0
  87. package/dist/api/stores/get.js +9 -19
  88. package/dist/api/stores/post.d.ts +4 -0
  89. package/dist/api/stores/post.js +7 -16
  90. package/dist/api/stores/put.d.ts +6 -0
  91. package/dist/api/stores/put.js +5 -13
  92. package/dist/api/stripe/get.d.ts +0 -0
  93. package/dist/api/stripe/post.d.ts +6 -0
  94. package/dist/api/stripe/post.js +7 -16
  95. package/dist/api/stripe/put.d.ts +0 -0
  96. package/dist/api/supplies/delete.d.ts +2 -0
  97. package/dist/api/supplies/delete.js +3 -10
  98. package/dist/api/supplies/get.d.ts +7 -0
  99. package/dist/api/supplies/get.js +7 -16
  100. package/dist/api/supplies/post.d.ts +11 -0
  101. package/dist/api/supplies/post.js +3 -10
  102. package/dist/api/supplies/put.d.ts +6 -0
  103. package/dist/api/supplies/put.js +5 -13
  104. package/dist/api/users/put.d.ts +10 -0
  105. package/dist/api/users/put.js +3 -10
  106. package/dist/enum/index.d.ts +10 -0
  107. package/dist/enum/index.js +4 -7
  108. package/dist/index.d.ts +3 -0
  109. package/dist/index.js +3 -33
  110. package/dist/interfaces/Api.d.ts +3 -0
  111. package/dist/interfaces/Api.js +1 -2
  112. package/dist/interfaces/Company.d.ts +0 -0
  113. package/dist/interfaces/Customer.d.ts +47 -0
  114. package/dist/interfaces/Customer.js +1 -2
  115. package/dist/interfaces/Order.d.ts +91 -0
  116. package/dist/interfaces/Order.js +1 -2
  117. package/dist/interfaces/Permission.d.ts +22 -0
  118. package/dist/interfaces/Permission.js +1 -2
  119. package/dist/interfaces/Product.d.ts +51 -0
  120. package/dist/interfaces/Product.js +1 -2
  121. package/dist/interfaces/Section.d.ts +13 -0
  122. package/dist/interfaces/Section.js +1 -2
  123. package/dist/interfaces/Store.d.ts +323 -0
  124. package/dist/interfaces/Store.js +1 -2
  125. package/dist/interfaces/StoreImage.d.ts +8 -0
  126. package/dist/interfaces/StoreImage.js +1 -2
  127. package/dist/interfaces/User.d.ts +38 -0
  128. package/dist/interfaces/User.js +1 -2
  129. package/dist/utils/apiUtils.d.ts +3 -0
  130. package/dist/utils/apiUtils.js +2 -6
  131. package/dist/utils/index.d.ts +1 -0
  132. package/dist/utils/index.js +1 -17
  133. package/dist/utils/orders/calculateOrderTotal.d.ts +5 -0
  134. package/dist/utils/orders/calculateOrderTotal.js +10 -14
  135. package/dist/utils/orders/calculateTotalTaxesIncluded.d.ts +9 -0
  136. package/dist/utils/orders/calculateTotalTaxesIncluded.js +3 -7
  137. package/dist/utils/orders/calculateTotalTaxesOverPrice.d.ts +8 -0
  138. package/dist/utils/orders/calculateTotalTaxesOverPrice.js +7 -11
  139. package/dist/utils/orders/helpers.d.ts +15 -0
  140. package/dist/utils/orders/helpers.js +6 -13
  141. package/dist/utils/orders/index.d.ts +2 -0
  142. package/dist/utils/orders/index.js +2 -5
  143. package/dist/utils/receipt/generateReceiptHTML.d.ts +0 -0
  144. package/dist/utils/util.d.ts +0 -0
  145. package/package.json +2 -1
  146. package/src/api/axiosInstance.ts +1 -0
  147. package/src/api/customers/get.ts +1 -1
  148. package/src/api/index.ts +11 -10
  149. package/src/api/order/delete.ts +15 -0
  150. package/src/api/order/get.ts +64 -0
  151. package/src/api/order/index.ts +4 -0
  152. package/src/api/order/post.ts +21 -0
  153. package/src/api/order/put.ts +53 -0
  154. package/src/utils/apiUtils.ts +1 -1
  155. package/tsconfig.json +10 -9
package/dist/api/index.js CHANGED
@@ -1,57 +1,33 @@
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';
30
+ import * as ordersEndpoints from './order';
55
31
  const WashdayClient = function WashdayClient(apiToken) {
56
32
  this.apiToken = apiToken;
57
33
  WashdayClient.prototype.customers.apiToken = apiToken;
@@ -69,6 +45,15 @@ const WashdayClient = function WashdayClient(apiToken) {
69
45
  WashdayClient.prototype.supplies.apiToken = apiToken;
70
46
  WashdayClient.prototype.inventory.apiToken = apiToken;
71
47
  WashdayClient.prototype.csv.apiToken = apiToken;
48
+ WashdayClient.prototype.orders.apiToken = apiToken;
49
+ };
50
+ WashdayClient.prototype.orders = {
51
+ getList: ordersEndpoints.getModule.getList,
52
+ getById: ordersEndpoints.getModule.getById,
53
+ updateById: ordersEndpoints.putModule.updateById,
54
+ updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
55
+ createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
56
+ deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
72
57
  };
73
58
  WashdayClient.prototype.customers = {
74
59
  getCustomers: customersEndpoints.getModule.getList,
@@ -80,15 +65,15 @@ WashdayClient.prototype.customers = {
80
65
  deleteById: customersEndpoints.deleteModule.deleteById,
81
66
  };
82
67
  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,
68
+ getStores: getStores,
69
+ getStoreById: getStoreById,
70
+ getStoreImages: getStoreImages,
71
+ createStore: createStore,
72
+ copyStore: copyStore,
73
+ updateStoreById: updateStoreById,
74
+ createStoreImage: createStoreImage,
75
+ getStoreReviewLink: getStoreReviewLink,
76
+ deleteStoreById: deleteStoreById,
92
77
  };
93
78
  WashdayClient.prototype.products = {
94
79
  getById: productsEndpoints.getModule.getById,
@@ -100,19 +85,19 @@ WashdayClient.prototype.products = {
100
85
  bulkUpdate: productsEndpoints.putModule.bulkUpdate
101
86
  };
102
87
  WashdayClient.prototype.users = {
103
- updateUserById: put_7.updateUserById,
88
+ updateUserById: updateUserById,
104
89
  };
105
90
  WashdayClient.prototype.countries = {
106
- getCountries: get_3.getCountries,
91
+ getCountries: getCountries,
107
92
  };
108
93
  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,
94
+ getSupplies: getSupplies,
95
+ getSupplyById: getSupplyById,
96
+ getSupplyHistory: getSupplyHistory,
97
+ createSupply: createSupply,
98
+ updateSupplyById: updateSupplyById,
99
+ addSupplyStock: addSupplyStock,
100
+ deleteSupplyById: deleteSupplyById,
116
101
  };
117
102
  WashdayClient.prototype.sections = {
118
103
  getSections: sectionsEndpoints.getModule.getList,
@@ -131,48 +116,48 @@ WashdayClient.prototype.inventory = {
131
116
  addStock: inventoryEndpoints.putModule.addStock,
132
117
  };
133
118
  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,
119
+ getCashierboxesByStoreId: getCashierboxesByStoreId,
120
+ getCashierboxesById: getCashierboxesById,
121
+ getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
122
+ createCashierBox: createCashierBox,
123
+ updateCashierBoxById: updateCashierBoxById,
124
+ deleteCashierBoxById: deleteCashierBoxById,
125
+ addCashierBoxMovement: addCashierBoxMovement,
141
126
  };
142
127
  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
128
+ getCompanyById: getCompanyById,
129
+ updateCompanyById: updateCompanyById,
130
+ updateCompanyLogoById: updateCompanyLogoById,
131
+ updateCompanyTaxInfoById: updateCompanyTaxInfoById,
132
+ updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
133
+ updateCFDIOrgLogo: updateCFDIOrgLogo
149
134
  };
150
135
  WashdayClient.prototype.stripe = {
151
- createCreateSuscriptionCheckoutSession: post_6.createCreateSuscriptionCheckoutSession,
152
- createCFDISuscrptionCheckoutSession: post_6.createCFDISuscrptionCheckoutSession,
153
- createCustomerPortalSession: post_6.createCustomerPortalSession
136
+ createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
137
+ createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
138
+ createCustomerPortalSession: createCustomerPortalSession
154
139
  };
155
140
  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,
141
+ getStoreStaff: getStoreStaff,
142
+ getStoreStaffById: getStoreStaffById,
143
+ updateStoreStaffById: updateStoreStaffById,
144
+ createStoreStaff: createStoreStaff,
145
+ deleteStoreStaffById: deleteStoreStaffById,
161
146
  };
162
147
  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,
148
+ getDiscountCodes: getDiscountCodes,
149
+ getDiscountCodeById: getDiscountCodeById,
150
+ verifyDiscountCode: verifyDiscountCode,
151
+ createDiscountCode: createDiscountCode,
152
+ deleteDiscountCodeById: deleteDiscountCodeById,
168
153
  };
169
154
  WashdayClient.prototype.automaticDiscount = {
170
- getAutomaticDiscounts: get_4.getAutomaticDiscounts,
171
- getAutomaticDiscountById: get_4.getAutomaticDiscountById,
172
- createAutomaticDiscount: post_3.createAutomaticDiscount,
173
- deleteAutomaticDiscountById: put_3.deleteAutomaticDiscountById,
155
+ getAutomaticDiscounts: getAutomaticDiscounts,
156
+ getAutomaticDiscountById: getAutomaticDiscountById,
157
+ createAutomaticDiscount: createAutomaticDiscount,
158
+ deleteAutomaticDiscountById: deleteAutomaticDiscountById,
174
159
  };
175
160
  WashdayClient.prototype.csv = {
176
161
  exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
177
162
  };
178
- exports.default = WashdayClient;
163
+ 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,25 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import axiosInstance from "../axiosInstance";
11
+ const GET_SET_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
12
+ export const deletePaymentLineById = function (orderId, id) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ try {
15
+ const config = {
16
+ headers: { Authorization: `Bearer ${this.apiToken}` }
17
+ };
18
+ return yield axiosInstance.delete(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, config);
19
+ }
20
+ catch (error) {
21
+ console.error('Error fetching deleteById:', error);
22
+ throw error;
23
+ }
24
+ });
25
+ };
@@ -0,0 +1,58 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { generateQueryParamsStr } from "../../utils/apiUtils";
11
+ import axiosInstance from "../axiosInstance";
12
+ const GET_SET_ORDER = 'api/v2/order';
13
+ const GET_SET_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
14
+ export const getList = function (params) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ try {
17
+ const config = {
18
+ headers: { Authorization: `Bearer ${this.apiToken}` }
19
+ };
20
+ const queryParams = generateQueryParamsStr([
21
+ 'storeId',
22
+ 'status',
23
+ 'name',
24
+ 'phone',
25
+ 'email',
26
+ 'fromDate',
27
+ 'toDate',
28
+ 'sequence',
29
+ 'pageNum',
30
+ 'limit',
31
+ 'sequenceSort',
32
+ 'cleanedDateTime',
33
+ 'readyDateTime',
34
+ 'collectedDateTime',
35
+ 'q',
36
+ ], params);
37
+ return yield axiosInstance.get(`${GET_SET_ORDER}?${queryParams}`, config);
38
+ }
39
+ catch (error) {
40
+ console.error('Error fetching getList orders:', error);
41
+ throw error;
42
+ }
43
+ });
44
+ };
45
+ export const getById = function (id) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ try {
48
+ const config = {
49
+ headers: { Authorization: `Bearer ${this.apiToken}` }
50
+ };
51
+ return yield axiosInstance.get(`${GET_SET_ORDER}/${id}`, config);
52
+ }
53
+ catch (error) {
54
+ console.error('Error fetching:', error);
55
+ throw error;
56
+ }
57
+ });
58
+ };
@@ -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';
@@ -0,0 +1,26 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import axiosInstance from "../axiosInstance";
11
+ const GET_SET_CUSTOMERS = 'api/customer';
12
+ const GET_SET_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
13
+ export const createPaymentLine = function (id, data) {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ try {
16
+ const config = {
17
+ headers: { Authorization: `Bearer ${this.apiToken}` }
18
+ };
19
+ return yield axiosInstance.post(`${GET_SET_ORDER_PAYMENTLINES(id)}`, data, config);
20
+ }
21
+ catch (error) {
22
+ console.error('Error fetching create:', error);
23
+ throw error;
24
+ }
25
+ });
26
+ };