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.
- package/dist/api/axiosInstance.d.ts +2 -0
- package/dist/api/axiosInstance.js +4 -8
- package/dist/api/cashierbox/delete.d.ts +2 -0
- package/dist/api/cashierbox/delete.js +3 -10
- package/dist/api/cashierbox/get.d.ts +7 -0
- package/dist/api/cashierbox/get.js +7 -16
- package/dist/api/cashierbox/post.d.ts +11 -0
- package/dist/api/cashierbox/post.js +5 -13
- package/dist/api/cashierbox/put.d.ts +4 -0
- package/dist/api/cashierbox/put.js +3 -10
- package/dist/api/companies/get.d.ts +2 -0
- package/dist/api/companies/get.js +3 -10
- package/dist/api/companies/post.d.ts +3 -0
- package/dist/api/companies/post.js +5 -13
- package/dist/api/companies/put.d.ts +4 -0
- package/dist/api/companies/put.js +7 -16
- package/dist/api/countries/get.d.ts +2 -0
- package/dist/api/countries/get.js +3 -10
- package/dist/api/countries/post.d.ts +0 -0
- package/dist/api/countries/put.d.ts +0 -0
- package/dist/api/csv/get.d.ts +11 -0
- package/dist/api/csv/get.js +5 -12
- package/dist/api/csv/index.d.ts +1 -0
- package/dist/api/csv/index.js +1 -27
- package/dist/api/customers/delete.d.ts +2 -0
- package/dist/api/customers/delete.js +3 -10
- package/dist/api/customers/get.d.ts +28 -0
- package/dist/api/customers/get.js +12 -22
- package/dist/api/customers/index.d.ts +4 -0
- package/dist/api/customers/index.js +4 -30
- package/dist/api/customers/post.d.ts +18 -0
- package/dist/api/customers/post.js +3 -10
- package/dist/api/customers/put.d.ts +18 -0
- package/dist/api/customers/put.js +3 -10
- package/dist/api/discounts/get.d.ts +6 -0
- package/dist/api/discounts/get.js +11 -22
- package/dist/api/discounts/post.d.ts +3 -0
- package/dist/api/discounts/post.js +5 -13
- package/dist/api/discounts/put.d.ts +3 -0
- package/dist/api/discounts/put.js +5 -13
- package/dist/api/index.d.ts +7 -0
- package/dist/api/index.js +88 -103
- package/dist/api/inventory/delete.d.ts +2 -0
- package/dist/api/inventory/delete.js +3 -10
- package/dist/api/inventory/get.d.ts +7 -0
- package/dist/api/inventory/get.js +7 -16
- package/dist/api/inventory/index.d.ts +4 -0
- package/dist/api/inventory/index.js +4 -30
- package/dist/api/inventory/post.d.ts +7 -0
- package/dist/api/inventory/post.js +3 -10
- package/dist/api/inventory/put.d.ts +8 -0
- package/dist/api/inventory/put.js +5 -13
- package/dist/api/order/delete.js +25 -0
- package/dist/api/order/get.js +58 -0
- package/dist/api/order/index.js +4 -0
- package/dist/api/order/post.js +26 -0
- package/dist/api/order/put.js +40 -0
- package/dist/api/products/delete.d.ts +3 -0
- package/dist/api/products/delete.js +5 -13
- package/dist/api/products/get.d.ts +2 -0
- package/dist/api/products/get.js +3 -10
- package/dist/api/products/index.d.ts +4 -0
- package/dist/api/products/index.js +4 -30
- package/dist/api/products/post.d.ts +27 -0
- package/dist/api/products/post.js +5 -13
- package/dist/api/products/put.d.ts +21 -0
- package/dist/api/products/put.js +5 -13
- package/dist/api/sections/delete.d.ts +2 -0
- package/dist/api/sections/delete.js +3 -10
- package/dist/api/sections/get.d.ts +7 -0
- package/dist/api/sections/get.js +5 -13
- package/dist/api/sections/index.d.ts +4 -0
- package/dist/api/sections/index.js +4 -30
- package/dist/api/sections/post.d.ts +7 -0
- package/dist/api/sections/post.js +3 -10
- package/dist/api/sections/put.d.ts +8 -0
- package/dist/api/sections/put.js +3 -10
- package/dist/api/staff/delete.d.ts +2 -0
- package/dist/api/staff/delete.js +3 -10
- package/dist/api/staff/get.d.ts +3 -0
- package/dist/api/staff/get.js +5 -13
- package/dist/api/staff/post.d.ts +2 -0
- package/dist/api/staff/post.js +3 -10
- package/dist/api/staff/put.d.ts +2 -0
- package/dist/api/staff/put.js +3 -10
- package/dist/api/stores/get.d.ts +12 -0
- package/dist/api/stores/get.js +9 -19
- package/dist/api/stores/post.d.ts +4 -0
- package/dist/api/stores/post.js +7 -16
- package/dist/api/stores/put.d.ts +6 -0
- package/dist/api/stores/put.js +5 -13
- package/dist/api/stripe/get.d.ts +0 -0
- package/dist/api/stripe/post.d.ts +6 -0
- package/dist/api/stripe/post.js +7 -16
- package/dist/api/stripe/put.d.ts +0 -0
- package/dist/api/supplies/delete.d.ts +2 -0
- package/dist/api/supplies/delete.js +3 -10
- package/dist/api/supplies/get.d.ts +7 -0
- package/dist/api/supplies/get.js +7 -16
- package/dist/api/supplies/post.d.ts +11 -0
- package/dist/api/supplies/post.js +3 -10
- package/dist/api/supplies/put.d.ts +6 -0
- package/dist/api/supplies/put.js +5 -13
- package/dist/api/users/put.d.ts +10 -0
- package/dist/api/users/put.js +3 -10
- package/dist/enum/index.d.ts +10 -0
- package/dist/enum/index.js +4 -7
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -33
- package/dist/interfaces/Api.d.ts +3 -0
- package/dist/interfaces/Api.js +1 -2
- package/dist/interfaces/Company.d.ts +0 -0
- package/dist/interfaces/Customer.d.ts +47 -0
- package/dist/interfaces/Customer.js +1 -2
- package/dist/interfaces/Order.d.ts +91 -0
- package/dist/interfaces/Order.js +1 -2
- package/dist/interfaces/Permission.d.ts +22 -0
- package/dist/interfaces/Permission.js +1 -2
- package/dist/interfaces/Product.d.ts +51 -0
- package/dist/interfaces/Product.js +1 -2
- package/dist/interfaces/Section.d.ts +13 -0
- package/dist/interfaces/Section.js +1 -2
- package/dist/interfaces/Store.d.ts +323 -0
- package/dist/interfaces/Store.js +1 -2
- package/dist/interfaces/StoreImage.d.ts +8 -0
- package/dist/interfaces/StoreImage.js +1 -2
- package/dist/interfaces/User.d.ts +38 -0
- package/dist/interfaces/User.js +1 -2
- package/dist/utils/apiUtils.d.ts +3 -0
- package/dist/utils/apiUtils.js +2 -6
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -17
- package/dist/utils/orders/calculateOrderTotal.d.ts +5 -0
- package/dist/utils/orders/calculateOrderTotal.js +10 -14
- package/dist/utils/orders/calculateTotalTaxesIncluded.d.ts +9 -0
- package/dist/utils/orders/calculateTotalTaxesIncluded.js +3 -7
- package/dist/utils/orders/calculateTotalTaxesOverPrice.d.ts +8 -0
- package/dist/utils/orders/calculateTotalTaxesOverPrice.js +7 -11
- package/dist/utils/orders/helpers.d.ts +15 -0
- package/dist/utils/orders/helpers.js +6 -13
- package/dist/utils/orders/index.d.ts +2 -0
- package/dist/utils/orders/index.js +2 -5
- package/dist/utils/receipt/generateReceiptHTML.d.ts +0 -0
- package/dist/utils/util.d.ts +0 -0
- package/package.json +2 -1
- package/src/api/axiosInstance.ts +1 -0
- package/src/api/customers/get.ts +1 -1
- package/src/api/index.ts +11 -10
- package/src/api/order/delete.ts +15 -0
- package/src/api/order/get.ts +64 -0
- package/src/api/order/index.ts +4 -0
- package/src/api/order/post.ts +21 -0
- package/src/api/order/put.ts +53 -0
- package/src/utils/apiUtils.ts +1 -1
- package/tsconfig.json +10 -9
package/dist/api/index.js
CHANGED
|
@@ -1,57 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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:
|
|
84
|
-
getStoreById:
|
|
85
|
-
getStoreImages:
|
|
86
|
-
createStore:
|
|
87
|
-
copyStore:
|
|
88
|
-
updateStoreById:
|
|
89
|
-
createStoreImage:
|
|
90
|
-
getStoreReviewLink:
|
|
91
|
-
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:
|
|
88
|
+
updateUserById: updateUserById,
|
|
104
89
|
};
|
|
105
90
|
WashdayClient.prototype.countries = {
|
|
106
|
-
getCountries:
|
|
91
|
+
getCountries: getCountries,
|
|
107
92
|
};
|
|
108
93
|
WashdayClient.prototype.supplies = {
|
|
109
|
-
getSupplies:
|
|
110
|
-
getSupplyById:
|
|
111
|
-
getSupplyHistory:
|
|
112
|
-
createSupply:
|
|
113
|
-
updateSupplyById:
|
|
114
|
-
addSupplyStock:
|
|
115
|
-
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:
|
|
135
|
-
getCashierboxesById:
|
|
136
|
-
getCashierBoxMovementsHistory:
|
|
137
|
-
createCashierBox:
|
|
138
|
-
updateCashierBoxById:
|
|
139
|
-
deleteCashierBoxById:
|
|
140
|
-
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:
|
|
144
|
-
updateCompanyById:
|
|
145
|
-
updateCompanyLogoById:
|
|
146
|
-
updateCompanyTaxInfoById:
|
|
147
|
-
updateCompanyTaxInfoCertificates:
|
|
148
|
-
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:
|
|
152
|
-
createCFDISuscrptionCheckoutSession:
|
|
153
|
-
createCustomerPortalSession:
|
|
136
|
+
createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
|
|
137
|
+
createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
|
|
138
|
+
createCustomerPortalSession: createCustomerPortalSession
|
|
154
139
|
};
|
|
155
140
|
WashdayClient.prototype.staff = {
|
|
156
|
-
getStoreStaff:
|
|
157
|
-
getStoreStaffById:
|
|
158
|
-
updateStoreStaffById:
|
|
159
|
-
createStoreStaff:
|
|
160
|
-
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:
|
|
164
|
-
getDiscountCodeById:
|
|
165
|
-
verifyDiscountCode:
|
|
166
|
-
createDiscountCode:
|
|
167
|
-
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:
|
|
171
|
-
getAutomaticDiscountById:
|
|
172
|
-
createAutomaticDiscount:
|
|
173
|
-
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
|
-
|
|
163
|
+
export default WashdayClient;
|
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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;
|
|
@@ -1,30 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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';
|
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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,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
|
+
};
|