washday-sdk 0.0.71 → 0.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +78 -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/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 +0 -10
- package/src/utils/apiUtils.ts +1 -1
- package/tsconfig.json +10 -9
package/dist/api/index.js
CHANGED
|
@@ -1,57 +1,32 @@
|
|
|
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
|
-
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:
|
|
84
|
-
getStoreById:
|
|
85
|
-
getStoreImages:
|
|
86
|
-
createStore:
|
|
87
|
-
copyStore:
|
|
88
|
-
updateStoreById:
|
|
89
|
-
createStoreImage:
|
|
90
|
-
getStoreReviewLink:
|
|
91
|
-
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:
|
|
78
|
+
updateUserById: updateUserById,
|
|
104
79
|
};
|
|
105
80
|
WashdayClient.prototype.countries = {
|
|
106
|
-
getCountries:
|
|
81
|
+
getCountries: getCountries,
|
|
107
82
|
};
|
|
108
83
|
WashdayClient.prototype.supplies = {
|
|
109
|
-
getSupplies:
|
|
110
|
-
getSupplyById:
|
|
111
|
-
getSupplyHistory:
|
|
112
|
-
createSupply:
|
|
113
|
-
updateSupplyById:
|
|
114
|
-
addSupplyStock:
|
|
115
|
-
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:
|
|
135
|
-
getCashierboxesById:
|
|
136
|
-
getCashierBoxMovementsHistory:
|
|
137
|
-
createCashierBox:
|
|
138
|
-
updateCashierBoxById:
|
|
139
|
-
deleteCashierBoxById:
|
|
140
|
-
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:
|
|
144
|
-
updateCompanyById:
|
|
145
|
-
updateCompanyLogoById:
|
|
146
|
-
updateCompanyTaxInfoById:
|
|
147
|
-
updateCompanyTaxInfoCertificates:
|
|
148
|
-
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:
|
|
152
|
-
createCFDISuscrptionCheckoutSession:
|
|
153
|
-
createCustomerPortalSession:
|
|
126
|
+
createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
|
|
127
|
+
createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
|
|
128
|
+
createCustomerPortalSession: createCustomerPortalSession
|
|
154
129
|
};
|
|
155
130
|
WashdayClient.prototype.staff = {
|
|
156
|
-
getStoreStaff:
|
|
157
|
-
getStoreStaffById:
|
|
158
|
-
updateStoreStaffById:
|
|
159
|
-
createStoreStaff:
|
|
160
|
-
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:
|
|
164
|
-
getDiscountCodeById:
|
|
165
|
-
verifyDiscountCode:
|
|
166
|
-
createDiscountCode:
|
|
167
|
-
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:
|
|
171
|
-
getAutomaticDiscountById:
|
|
172
|
-
createAutomaticDiscount:
|
|
173
|
-
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
|
-
|
|
153
|
+
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,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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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;
|
package/dist/api/products/get.js
CHANGED
|
@@ -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.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
|
|
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;
|
|
@@ -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';
|