washday-sdk 0.0.73 → 0.0.74
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/index.js +113 -129
- package/dist/api/order/get.js +0 -1
- package/dist/api/order/post.js +0 -1
- package/package.json +1 -1
- package/src/api/index.ts +115 -152
- package/src/api/order/get.ts +1 -3
- package/src/api/order/post.ts +0 -1
- package/src/interfaces/Api.ts +146 -2
package/dist/api/index.js
CHANGED
|
@@ -30,134 +30,118 @@ import * as csvExportEndpoints from './csv';
|
|
|
30
30
|
import * as ordersEndpoints from './order';
|
|
31
31
|
const WashdayClient = function WashdayClient(apiToken) {
|
|
32
32
|
this.apiToken = apiToken;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
};
|
|
147
|
-
WashdayClient.prototype.discountCodes = {
|
|
148
|
-
getDiscountCodes: getDiscountCodes,
|
|
149
|
-
getDiscountCodeById: getDiscountCodeById,
|
|
150
|
-
verifyDiscountCode: verifyDiscountCode,
|
|
151
|
-
createDiscountCode: createDiscountCode,
|
|
152
|
-
deleteDiscountCodeById: deleteDiscountCodeById,
|
|
153
|
-
};
|
|
154
|
-
WashdayClient.prototype.automaticDiscount = {
|
|
155
|
-
getAutomaticDiscounts: getAutomaticDiscounts,
|
|
156
|
-
getAutomaticDiscountById: getAutomaticDiscountById,
|
|
157
|
-
createAutomaticDiscount: createAutomaticDiscount,
|
|
158
|
-
deleteAutomaticDiscountById: deleteAutomaticDiscountById,
|
|
159
|
-
};
|
|
160
|
-
WashdayClient.prototype.csv = {
|
|
161
|
-
exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
|
|
33
|
+
this.orders = {
|
|
34
|
+
getList: ordersEndpoints.getModule.getList,
|
|
35
|
+
getById: ordersEndpoints.getModule.getById,
|
|
36
|
+
updateById: ordersEndpoints.putModule.updateById,
|
|
37
|
+
updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
|
|
38
|
+
createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
|
|
39
|
+
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
|
40
|
+
};
|
|
41
|
+
this.customers = {
|
|
42
|
+
getCustomers: customersEndpoints.getModule.getList,
|
|
43
|
+
getCustomerById: customersEndpoints.getModule.getCustomerById,
|
|
44
|
+
getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
|
|
45
|
+
getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
|
|
46
|
+
create: customersEndpoints.postModule.create,
|
|
47
|
+
updateById: customersEndpoints.putModule.updateById,
|
|
48
|
+
deleteById: customersEndpoints.deleteModule.deleteById,
|
|
49
|
+
};
|
|
50
|
+
this.stores = {
|
|
51
|
+
getStores: getStores,
|
|
52
|
+
getStoreById: getStoreById,
|
|
53
|
+
getStoreImages: getStoreImages,
|
|
54
|
+
createStore: createStore,
|
|
55
|
+
copyStore: copyStore,
|
|
56
|
+
updateStoreById: updateStoreById,
|
|
57
|
+
createStoreImage: createStoreImage,
|
|
58
|
+
getStoreReviewLink: getStoreReviewLink,
|
|
59
|
+
deleteStoreById: deleteStoreById,
|
|
60
|
+
};
|
|
61
|
+
this.products = {
|
|
62
|
+
getById: productsEndpoints.getModule.getById,
|
|
63
|
+
create: productsEndpoints.postModule.create,
|
|
64
|
+
createProductSupply: productsEndpoints.postModule.createProductSupply,
|
|
65
|
+
deleteById: productsEndpoints.deleteModule.deleteById,
|
|
66
|
+
deleteProductSupplyById: productsEndpoints.deleteModule.deleteProductSupplyById,
|
|
67
|
+
updateById: productsEndpoints.putModule.updateById,
|
|
68
|
+
bulkUpdate: productsEndpoints.putModule.bulkUpdate
|
|
69
|
+
};
|
|
70
|
+
this.users = {
|
|
71
|
+
updateUserById: updateUserById,
|
|
72
|
+
};
|
|
73
|
+
this.countries = {
|
|
74
|
+
getCountries: getCountries,
|
|
75
|
+
};
|
|
76
|
+
this.supplies = {
|
|
77
|
+
getSupplies: getSupplies,
|
|
78
|
+
getSupplyById: getSupplyById,
|
|
79
|
+
getSupplyHistory: getSupplyHistory,
|
|
80
|
+
createSupply: createSupply,
|
|
81
|
+
updateSupplyById: updateSupplyById,
|
|
82
|
+
addSupplyStock: addSupplyStock,
|
|
83
|
+
deleteSupplyById: deleteSupplyById,
|
|
84
|
+
};
|
|
85
|
+
this.sections = {
|
|
86
|
+
getSections: sectionsEndpoints.getModule.getList,
|
|
87
|
+
getById: sectionsEndpoints.getModule.getById,
|
|
88
|
+
create: sectionsEndpoints.postModule.create,
|
|
89
|
+
deleteById: sectionsEndpoints.deleteModule.deleteById,
|
|
90
|
+
updateById: sectionsEndpoints.putModule.updateById,
|
|
91
|
+
};
|
|
92
|
+
this.inventory = {
|
|
93
|
+
getInventory: inventoryEndpoints.getModule.getInventory,
|
|
94
|
+
getById: inventoryEndpoints.getModule.getInventoryById,
|
|
95
|
+
getHistoryById: inventoryEndpoints.getModule.getHistoryById,
|
|
96
|
+
create: inventoryEndpoints.postModule.create,
|
|
97
|
+
deleteById: inventoryEndpoints.deleteModule.deleteById,
|
|
98
|
+
updateById: inventoryEndpoints.putModule.updateById,
|
|
99
|
+
addStock: inventoryEndpoints.putModule.addStock,
|
|
100
|
+
};
|
|
101
|
+
this.cashierboxes = {
|
|
102
|
+
getCashierboxesByStoreId: getCashierboxesByStoreId,
|
|
103
|
+
getCashierboxesById: getCashierboxesById,
|
|
104
|
+
getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
|
|
105
|
+
createCashierBox: createCashierBox,
|
|
106
|
+
updateCashierBoxById: updateCashierBoxById,
|
|
107
|
+
deleteCashierBoxById: deleteCashierBoxById,
|
|
108
|
+
addCashierBoxMovement: addCashierBoxMovement,
|
|
109
|
+
};
|
|
110
|
+
this.companies = {
|
|
111
|
+
getCompanyById: getCompanyById,
|
|
112
|
+
updateCompanyById: updateCompanyById,
|
|
113
|
+
updateCompanyLogoById: updateCompanyLogoById,
|
|
114
|
+
updateCompanyTaxInfoById: updateCompanyTaxInfoById,
|
|
115
|
+
updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
|
|
116
|
+
updateCFDIOrgLogo: updateCFDIOrgLogo
|
|
117
|
+
};
|
|
118
|
+
this.stripe = {
|
|
119
|
+
createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
|
|
120
|
+
createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
|
|
121
|
+
createCustomerPortalSession: createCustomerPortalSession
|
|
122
|
+
};
|
|
123
|
+
this.staff = {
|
|
124
|
+
getStoreStaff: getStoreStaff,
|
|
125
|
+
getStoreStaffById: getStoreStaffById,
|
|
126
|
+
updateStoreStaffById: updateStoreStaffById,
|
|
127
|
+
createStoreStaff: createStoreStaff,
|
|
128
|
+
deleteStoreStaffById: deleteStoreStaffById,
|
|
129
|
+
};
|
|
130
|
+
this.discountCodes = {
|
|
131
|
+
getDiscountCodes: getDiscountCodes,
|
|
132
|
+
getDiscountCodeById: getDiscountCodeById,
|
|
133
|
+
verifyDiscountCode: verifyDiscountCode,
|
|
134
|
+
createDiscountCode: createDiscountCode,
|
|
135
|
+
deleteDiscountCodeById: deleteDiscountCodeById,
|
|
136
|
+
};
|
|
137
|
+
this.automaticDiscount = {
|
|
138
|
+
getAutomaticDiscounts: getAutomaticDiscounts,
|
|
139
|
+
getAutomaticDiscountById: getAutomaticDiscountById,
|
|
140
|
+
createAutomaticDiscount: createAutomaticDiscount,
|
|
141
|
+
deleteAutomaticDiscountById: deleteAutomaticDiscountById,
|
|
142
|
+
};
|
|
143
|
+
this.csv = {
|
|
144
|
+
exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
|
|
145
|
+
};
|
|
162
146
|
};
|
|
163
147
|
export default WashdayClient;
|
package/dist/api/order/get.js
CHANGED
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
11
11
|
import axiosInstance from "../axiosInstance";
|
|
12
12
|
const GET_SET_ORDER = 'api/v2/order';
|
|
13
|
-
const GET_SET_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
|
|
14
13
|
export const getList = function (params) {
|
|
15
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
15
|
try {
|
package/dist/api/order/post.js
CHANGED
|
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import axiosInstance from "../axiosInstance";
|
|
11
|
-
const GET_SET_CUSTOMERS = 'api/customer';
|
|
12
11
|
const GET_SET_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
|
|
13
12
|
export const createPaymentLine = function (id, data) {
|
|
14
13
|
return __awaiter(this, void 0, void 0, function* () {
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { getCompanyById } from "./companies/get";
|
|
|
7
7
|
import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
|
|
8
8
|
import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
|
|
9
9
|
import { getCountries } from "./countries/get";
|
|
10
|
-
import { getCustomerById, getCustomerHighlightsById } from "./customers/get";
|
|
11
10
|
import { getAutomaticDiscountById, getAutomaticDiscounts, getDiscountCodeById, getDiscountCodes, verifyDiscountCode } from './discounts/get';
|
|
12
11
|
import { createAutomaticDiscount, createDiscountCode } from "./discounts/post";
|
|
13
12
|
import { deleteAutomaticDiscountById, deleteDiscountCodeById } from "./discounts/put";
|
|
@@ -32,160 +31,124 @@ import * as csvExportEndpoints from './csv';
|
|
|
32
31
|
import * as ordersEndpoints from './order';
|
|
33
32
|
|
|
34
33
|
type WashdayClientConstructor = {
|
|
35
|
-
new(apiToken: string):
|
|
36
|
-
apiToken: string;
|
|
37
|
-
};
|
|
34
|
+
new(apiToken: string): WashdayClientInstance
|
|
38
35
|
};
|
|
39
36
|
|
|
40
37
|
const WashdayClient: WashdayClientConstructor = function WashdayClient(this: WashdayClientInstance, apiToken: string) {
|
|
41
38
|
this.apiToken = apiToken;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
this.orders = {
|
|
40
|
+
getList: ordersEndpoints.getModule.getList,
|
|
41
|
+
getById: ordersEndpoints.getModule.getById,
|
|
42
|
+
updateById: ordersEndpoints.putModule.updateById,
|
|
43
|
+
updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
|
|
44
|
+
createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
|
|
45
|
+
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
|
46
|
+
};
|
|
47
|
+
this.customers = {
|
|
48
|
+
getCustomers: customersEndpoints.getModule.getList,
|
|
49
|
+
getCustomerById: customersEndpoints.getModule.getCustomerById,
|
|
50
|
+
getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
|
|
51
|
+
getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
|
|
52
|
+
create: customersEndpoints.postModule.create,
|
|
53
|
+
updateById: customersEndpoints.putModule.updateById,
|
|
54
|
+
deleteById: customersEndpoints.deleteModule.deleteById,
|
|
55
|
+
};
|
|
56
|
+
this.stores = {
|
|
57
|
+
getStores: getStores,
|
|
58
|
+
getStoreById: getStoreById,
|
|
59
|
+
getStoreImages: getStoreImages,
|
|
60
|
+
createStore: createStore,
|
|
61
|
+
copyStore: copyStore,
|
|
62
|
+
updateStoreById: updateStoreById,
|
|
63
|
+
createStoreImage: createStoreImage,
|
|
64
|
+
getStoreReviewLink: getStoreReviewLink,
|
|
65
|
+
deleteStoreById: deleteStoreById,
|
|
66
|
+
};
|
|
67
|
+
this.products = {
|
|
68
|
+
getById: productsEndpoints.getModule.getById,
|
|
69
|
+
create: productsEndpoints.postModule.create,
|
|
70
|
+
createProductSupply: productsEndpoints.postModule.createProductSupply,
|
|
71
|
+
deleteById: productsEndpoints.deleteModule.deleteById,
|
|
72
|
+
deleteProductSupplyById: productsEndpoints.deleteModule.deleteProductSupplyById,
|
|
73
|
+
updateById: productsEndpoints.putModule.updateById,
|
|
74
|
+
bulkUpdate: productsEndpoints.putModule.bulkUpdate
|
|
75
|
+
};
|
|
76
|
+
this.users = {
|
|
77
|
+
updateUserById: updateUserById,
|
|
78
|
+
};
|
|
79
|
+
this.countries = {
|
|
80
|
+
getCountries: getCountries,
|
|
81
|
+
};
|
|
82
|
+
this.supplies = {
|
|
83
|
+
getSupplies: getSupplies,
|
|
84
|
+
getSupplyById: getSupplyById,
|
|
85
|
+
getSupplyHistory: getSupplyHistory,
|
|
86
|
+
createSupply: createSupply,
|
|
87
|
+
updateSupplyById: updateSupplyById,
|
|
88
|
+
addSupplyStock: addSupplyStock,
|
|
89
|
+
deleteSupplyById: deleteSupplyById,
|
|
90
|
+
};
|
|
91
|
+
this.sections = {
|
|
92
|
+
getSections: sectionsEndpoints.getModule.getList,
|
|
93
|
+
getById: sectionsEndpoints.getModule.getById,
|
|
94
|
+
create: sectionsEndpoints.postModule.create,
|
|
95
|
+
deleteById: sectionsEndpoints.deleteModule.deleteById,
|
|
96
|
+
updateById: sectionsEndpoints.putModule.updateById,
|
|
97
|
+
};
|
|
98
|
+
this.inventory = {
|
|
99
|
+
getInventory: inventoryEndpoints.getModule.getInventory,
|
|
100
|
+
getById: inventoryEndpoints.getModule.getInventoryById,
|
|
101
|
+
getHistoryById: inventoryEndpoints.getModule.getHistoryById,
|
|
102
|
+
create: inventoryEndpoints.postModule.create,
|
|
103
|
+
deleteById: inventoryEndpoints.deleteModule.deleteById,
|
|
104
|
+
updateById: inventoryEndpoints.putModule.updateById,
|
|
105
|
+
addStock: inventoryEndpoints.putModule.addStock,
|
|
106
|
+
};
|
|
107
|
+
this.cashierboxes = {
|
|
108
|
+
getCashierboxesByStoreId: getCashierboxesByStoreId,
|
|
109
|
+
getCashierboxesById: getCashierboxesById,
|
|
110
|
+
getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
|
|
111
|
+
createCashierBox: createCashierBox,
|
|
112
|
+
updateCashierBoxById: updateCashierBoxById,
|
|
113
|
+
deleteCashierBoxById: deleteCashierBoxById,
|
|
114
|
+
addCashierBoxMovement: addCashierBoxMovement,
|
|
115
|
+
};
|
|
116
|
+
this.companies = {
|
|
117
|
+
getCompanyById: getCompanyById,
|
|
118
|
+
updateCompanyById: updateCompanyById,
|
|
119
|
+
updateCompanyLogoById: updateCompanyLogoById,
|
|
120
|
+
updateCompanyTaxInfoById: updateCompanyTaxInfoById,
|
|
121
|
+
updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
|
|
122
|
+
updateCFDIOrgLogo: updateCFDIOrgLogo
|
|
123
|
+
};
|
|
124
|
+
this.stripe = {
|
|
125
|
+
createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
|
|
126
|
+
createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
|
|
127
|
+
createCustomerPortalSession: createCustomerPortalSession
|
|
128
|
+
};
|
|
129
|
+
this.staff = {
|
|
130
|
+
getStoreStaff: getStoreStaff,
|
|
131
|
+
getStoreStaffById: getStoreStaffById,
|
|
132
|
+
updateStoreStaffById: updateStoreStaffById,
|
|
133
|
+
createStoreStaff: createStoreStaff,
|
|
134
|
+
deleteStoreStaffById: deleteStoreStaffById,
|
|
135
|
+
};
|
|
136
|
+
this.discountCodes = {
|
|
137
|
+
getDiscountCodes: getDiscountCodes,
|
|
138
|
+
getDiscountCodeById: getDiscountCodeById,
|
|
139
|
+
verifyDiscountCode: verifyDiscountCode,
|
|
140
|
+
createDiscountCode: createDiscountCode,
|
|
141
|
+
deleteDiscountCodeById: deleteDiscountCodeById,
|
|
142
|
+
};
|
|
143
|
+
this.automaticDiscount = {
|
|
144
|
+
getAutomaticDiscounts: getAutomaticDiscounts,
|
|
145
|
+
getAutomaticDiscountById: getAutomaticDiscountById,
|
|
146
|
+
createAutomaticDiscount: createAutomaticDiscount,
|
|
147
|
+
deleteAutomaticDiscountById: deleteAutomaticDiscountById,
|
|
148
|
+
};
|
|
149
|
+
this.csv = {
|
|
150
|
+
exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
|
|
151
|
+
};
|
|
58
152
|
} as any;
|
|
59
153
|
|
|
60
|
-
|
|
61
|
-
getList: ordersEndpoints.getModule.getList,
|
|
62
|
-
getById: ordersEndpoints.getModule.getById,
|
|
63
|
-
updateById: ordersEndpoints.putModule.updateById,
|
|
64
|
-
updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
|
|
65
|
-
createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
|
|
66
|
-
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
WashdayClient.prototype.customers = {
|
|
70
|
-
getCustomers: customersEndpoints.getModule.getList,
|
|
71
|
-
getCustomerById: customersEndpoints.getModule.getCustomerById,
|
|
72
|
-
getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
|
|
73
|
-
getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
|
|
74
|
-
create: customersEndpoints.postModule.create,
|
|
75
|
-
updateById: customersEndpoints.putModule.updateById,
|
|
76
|
-
deleteById: customersEndpoints.deleteModule.deleteById,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
WashdayClient.prototype.stores = {
|
|
80
|
-
getStores: getStores,
|
|
81
|
-
getStoreById: getStoreById,
|
|
82
|
-
getStoreImages: getStoreImages,
|
|
83
|
-
createStore: createStore,
|
|
84
|
-
copyStore: copyStore,
|
|
85
|
-
updateStoreById: updateStoreById,
|
|
86
|
-
createStoreImage: createStoreImage,
|
|
87
|
-
getStoreReviewLink: getStoreReviewLink,
|
|
88
|
-
deleteStoreById: deleteStoreById,
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
WashdayClient.prototype.products = {
|
|
93
|
-
getById: productsEndpoints.getModule.getById,
|
|
94
|
-
create: productsEndpoints.postModule.create,
|
|
95
|
-
createProductSupply: productsEndpoints.postModule.createProductSupply,
|
|
96
|
-
deleteById: productsEndpoints.deleteModule.deleteById,
|
|
97
|
-
deleteProductSupplyById: productsEndpoints.deleteModule.deleteProductSupplyById,
|
|
98
|
-
updateById: productsEndpoints.putModule.updateById,
|
|
99
|
-
bulkUpdate: productsEndpoints.putModule.bulkUpdate
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
WashdayClient.prototype.users = {
|
|
103
|
-
updateUserById: updateUserById,
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
WashdayClient.prototype.countries = {
|
|
107
|
-
getCountries: getCountries,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
WashdayClient.prototype.supplies = {
|
|
111
|
-
getSupplies: getSupplies,
|
|
112
|
-
getSupplyById: getSupplyById,
|
|
113
|
-
getSupplyHistory: getSupplyHistory,
|
|
114
|
-
createSupply: createSupply,
|
|
115
|
-
updateSupplyById: updateSupplyById,
|
|
116
|
-
addSupplyStock: addSupplyStock,
|
|
117
|
-
deleteSupplyById: deleteSupplyById,
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
WashdayClient.prototype.sections = {
|
|
121
|
-
getSections: sectionsEndpoints.getModule.getList,
|
|
122
|
-
getById: sectionsEndpoints.getModule.getById,
|
|
123
|
-
create: sectionsEndpoints.postModule.create,
|
|
124
|
-
deleteById: sectionsEndpoints.deleteModule.deleteById,
|
|
125
|
-
updateById: sectionsEndpoints.putModule.updateById,
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
WashdayClient.prototype.inventory = {
|
|
129
|
-
getInventory: inventoryEndpoints.getModule.getInventory,
|
|
130
|
-
getById: inventoryEndpoints.getModule.getInventoryById,
|
|
131
|
-
getHistoryById: inventoryEndpoints.getModule.getHistoryById,
|
|
132
|
-
create: inventoryEndpoints.postModule.create,
|
|
133
|
-
deleteById: inventoryEndpoints.deleteModule.deleteById,
|
|
134
|
-
updateById: inventoryEndpoints.putModule.updateById,
|
|
135
|
-
addStock: inventoryEndpoints.putModule.addStock,
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
WashdayClient.prototype.cashierboxes = {
|
|
139
|
-
getCashierboxesByStoreId: getCashierboxesByStoreId,
|
|
140
|
-
getCashierboxesById: getCashierboxesById,
|
|
141
|
-
getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
|
|
142
|
-
createCashierBox: createCashierBox,
|
|
143
|
-
updateCashierBoxById: updateCashierBoxById,
|
|
144
|
-
deleteCashierBoxById: deleteCashierBoxById,
|
|
145
|
-
addCashierBoxMovement: addCashierBoxMovement,
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
WashdayClient.prototype.companies = {
|
|
149
|
-
getCompanyById: getCompanyById,
|
|
150
|
-
updateCompanyById: updateCompanyById,
|
|
151
|
-
updateCompanyLogoById: updateCompanyLogoById,
|
|
152
|
-
updateCompanyTaxInfoById: updateCompanyTaxInfoById,
|
|
153
|
-
updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
|
|
154
|
-
updateCFDIOrgLogo: updateCFDIOrgLogo
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
WashdayClient.prototype.stripe = {
|
|
158
|
-
createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
|
|
159
|
-
createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
|
|
160
|
-
createCustomerPortalSession: createCustomerPortalSession
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
WashdayClient.prototype.staff = {
|
|
164
|
-
getStoreStaff: getStoreStaff,
|
|
165
|
-
getStoreStaffById: getStoreStaffById,
|
|
166
|
-
updateStoreStaffById: updateStoreStaffById,
|
|
167
|
-
createStoreStaff: createStoreStaff,
|
|
168
|
-
deleteStoreStaffById: deleteStoreStaffById,
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
WashdayClient.prototype.discountCodes = {
|
|
172
|
-
getDiscountCodes: getDiscountCodes,
|
|
173
|
-
getDiscountCodeById: getDiscountCodeById,
|
|
174
|
-
verifyDiscountCode: verifyDiscountCode,
|
|
175
|
-
createDiscountCode: createDiscountCode,
|
|
176
|
-
deleteDiscountCodeById: deleteDiscountCodeById,
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
WashdayClient.prototype.automaticDiscount = {
|
|
180
|
-
getAutomaticDiscounts: getAutomaticDiscounts,
|
|
181
|
-
getAutomaticDiscountById: getAutomaticDiscountById,
|
|
182
|
-
createAutomaticDiscount: createAutomaticDiscount,
|
|
183
|
-
deleteAutomaticDiscountById: deleteAutomaticDiscountById,
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
WashdayClient.prototype.csv = {
|
|
188
|
-
exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
export default WashdayClient;
|
|
154
|
+
export default WashdayClient;
|
package/src/api/order/get.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
-
import {
|
|
3
|
-
import { IOrder, IOrderInfo } from "../../interfaces/Order";
|
|
2
|
+
import { IOrder } from "../../interfaces/Order";
|
|
4
3
|
import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
5
4
|
import axiosInstance from "../axiosInstance";
|
|
6
5
|
const GET_SET_ORDER = 'api/v2/order';
|
|
7
|
-
const GET_SET_ORDER_PAYMENTLINES = (orderId: string) => `/api/v2/order/${orderId}/paymentLines`;
|
|
8
6
|
|
|
9
7
|
export const getList = async function (this: WashdayClientInstance, params: {
|
|
10
8
|
storeId: string | undefined,
|
package/src/api/order/post.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
|
-
const GET_SET_CUSTOMERS = 'api/customer';
|
|
4
3
|
const GET_SET_ORDER_PAYMENTLINES = (orderId: string) => `/api/v2/order/${orderId}/paymentLines`;
|
|
5
4
|
|
|
6
5
|
export const createPaymentLine = async function (this: WashdayClientInstance, id: string, data: {
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -1,3 +1,147 @@
|
|
|
1
|
-
|
|
1
|
+
import { deleteCashierBoxById } from "../api/cashierbox/delete";
|
|
2
|
+
import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "../api/cashierbox/get";
|
|
3
|
+
import { addCashierBoxMovement, createCashierBox } from "../api/cashierbox/post";
|
|
4
|
+
import { updateCashierBoxById } from "../api/cashierbox/put";
|
|
5
|
+
import { getCompanyById } from "../api/companies/get";
|
|
6
|
+
import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "../api/companies/post";
|
|
7
|
+
import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "../api/companies/put";
|
|
8
|
+
import { getCountries } from "../api/countries/get";
|
|
9
|
+
import { getAutomaticDiscountById, getAutomaticDiscounts, getDiscountCodeById, getDiscountCodes, verifyDiscountCode } from '../api/discounts/get';
|
|
10
|
+
import { createAutomaticDiscount, createDiscountCode } from "../api/discounts/post";
|
|
11
|
+
import { deleteAutomaticDiscountById, deleteDiscountCodeById } from "../api/discounts/put";
|
|
12
|
+
import { deleteStoreStaffById } from "../api/staff/delete";
|
|
13
|
+
import { getStoreStaff, getStoreStaffById } from "../api/staff/get";
|
|
14
|
+
import { createStoreStaff } from "../api/staff/post";
|
|
15
|
+
import { updateStoreStaffById } from "../api/staff/put";
|
|
16
|
+
import { getStoreById, getStoreImages, getStoreReviewLink, getStores } from "../api/stores/get";
|
|
17
|
+
import { copyStore, createStore, createStoreImage } from "../api/stores/post";
|
|
18
|
+
import { deleteStoreById, updateStoreById } from "../api/stores/put";
|
|
19
|
+
import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession } from "../api/stripe/post";
|
|
20
|
+
import { deleteSupplyById } from "../api/supplies/delete";
|
|
21
|
+
import { getSupplies, getSupplyById, getSupplyHistory } from "../api/supplies/get";
|
|
22
|
+
import { createSupply } from "../api/supplies/post";
|
|
23
|
+
import { addSupplyStock, updateSupplyById } from "../api/supplies/put";
|
|
24
|
+
import { updateUserById } from "../api/users/put";
|
|
25
|
+
import * as inventoryEndpoints from '../api/inventory';
|
|
26
|
+
import * as sectionsEndpoints from '../api/sections';
|
|
27
|
+
import * as productsEndpoints from '../api/products';
|
|
28
|
+
import * as customersEndpoints from '../api/customers';
|
|
29
|
+
import * as csvExportEndpoints from '../api/csv';
|
|
30
|
+
import * as ordersEndpoints from '../api/order';
|
|
31
|
+
|
|
32
|
+
export interface WashdayClientInstance {
|
|
2
33
|
apiToken: string;
|
|
3
|
-
|
|
34
|
+
orders: {
|
|
35
|
+
getList: typeof ordersEndpoints.getModule.getList;
|
|
36
|
+
getById: typeof ordersEndpoints.getModule.getById;
|
|
37
|
+
updateById: typeof ordersEndpoints.putModule.updateById;
|
|
38
|
+
updatePaymentLineById: typeof ordersEndpoints.putModule.updatePaymentLineById;
|
|
39
|
+
createPaymentLine: typeof ordersEndpoints.postModule.createPaymentLine;
|
|
40
|
+
deletePaymentLineById: typeof ordersEndpoints.deleteModule.deletePaymentLineById;
|
|
41
|
+
};
|
|
42
|
+
customers: {
|
|
43
|
+
getCustomers: typeof customersEndpoints.getModule.getList;
|
|
44
|
+
getCustomerById: typeof customersEndpoints.getModule.getCustomerById;
|
|
45
|
+
getCustomerHighlightsById: typeof customersEndpoints.getModule.getCustomerHighlightsById;
|
|
46
|
+
getCustomerOrders: typeof customersEndpoints.getModule.getCustomerOrders;
|
|
47
|
+
create: typeof customersEndpoints.postModule.create;
|
|
48
|
+
updateById: typeof customersEndpoints.putModule.updateById;
|
|
49
|
+
deleteById: typeof customersEndpoints.deleteModule.deleteById;
|
|
50
|
+
};
|
|
51
|
+
stores: {
|
|
52
|
+
getStores: typeof getStores;
|
|
53
|
+
getStoreById: typeof getStoreById;
|
|
54
|
+
getStoreImages: typeof getStoreImages;
|
|
55
|
+
createStore: typeof createStore;
|
|
56
|
+
copyStore: typeof copyStore;
|
|
57
|
+
updateStoreById: typeof updateStoreById;
|
|
58
|
+
createStoreImage: typeof createStoreImage;
|
|
59
|
+
getStoreReviewLink: typeof getStoreReviewLink;
|
|
60
|
+
deleteStoreById: typeof deleteStoreById;
|
|
61
|
+
};
|
|
62
|
+
products: {
|
|
63
|
+
getById: typeof productsEndpoints.getModule.getById;
|
|
64
|
+
create: typeof productsEndpoints.postModule.create;
|
|
65
|
+
createProductSupply: typeof productsEndpoints.postModule.createProductSupply;
|
|
66
|
+
deleteById: typeof productsEndpoints.deleteModule.deleteById;
|
|
67
|
+
deleteProductSupplyById: typeof productsEndpoints.deleteModule.deleteProductSupplyById;
|
|
68
|
+
updateById: typeof productsEndpoints.putModule.updateById;
|
|
69
|
+
bulkUpdate: typeof productsEndpoints.putModule.bulkUpdate;
|
|
70
|
+
};
|
|
71
|
+
users: {
|
|
72
|
+
updateUserById: typeof updateUserById;
|
|
73
|
+
};
|
|
74
|
+
countries: {
|
|
75
|
+
getCountries: typeof getCountries;
|
|
76
|
+
};
|
|
77
|
+
supplies: {
|
|
78
|
+
getSupplies: typeof getSupplies;
|
|
79
|
+
getSupplyById: typeof getSupplyById;
|
|
80
|
+
getSupplyHistory: typeof getSupplyHistory;
|
|
81
|
+
createSupply: typeof createSupply;
|
|
82
|
+
updateSupplyById: typeof updateSupplyById;
|
|
83
|
+
addSupplyStock: typeof addSupplyStock;
|
|
84
|
+
deleteSupplyById: typeof deleteSupplyById;
|
|
85
|
+
};
|
|
86
|
+
sections: {
|
|
87
|
+
getSections: typeof sectionsEndpoints.getModule.getList;
|
|
88
|
+
getById: typeof sectionsEndpoints.getModule.getById;
|
|
89
|
+
create: typeof sectionsEndpoints.postModule.create;
|
|
90
|
+
deleteById: typeof sectionsEndpoints.deleteModule.deleteById;
|
|
91
|
+
updateById: typeof sectionsEndpoints.putModule.updateById;
|
|
92
|
+
};
|
|
93
|
+
inventory: {
|
|
94
|
+
getInventory: typeof inventoryEndpoints.getModule.getInventory;
|
|
95
|
+
getById: typeof inventoryEndpoints.getModule.getInventoryById;
|
|
96
|
+
getHistoryById: typeof inventoryEndpoints.getModule.getHistoryById;
|
|
97
|
+
create: typeof inventoryEndpoints.postModule.create;
|
|
98
|
+
deleteById: typeof inventoryEndpoints.deleteModule.deleteById;
|
|
99
|
+
updateById: typeof inventoryEndpoints.putModule.updateById;
|
|
100
|
+
addStock: typeof inventoryEndpoints.putModule.addStock;
|
|
101
|
+
};
|
|
102
|
+
cashierboxes: {
|
|
103
|
+
getCashierboxesByStoreId: typeof getCashierboxesByStoreId;
|
|
104
|
+
getCashierboxesById: typeof getCashierboxesById;
|
|
105
|
+
getCashierBoxMovementsHistory: typeof getCashierBoxMovementsHistory;
|
|
106
|
+
createCashierBox: typeof createCashierBox;
|
|
107
|
+
updateCashierBoxById: typeof updateCashierBoxById;
|
|
108
|
+
deleteCashierBoxById: typeof deleteCashierBoxById;
|
|
109
|
+
addCashierBoxMovement: typeof addCashierBoxMovement;
|
|
110
|
+
};
|
|
111
|
+
companies: {
|
|
112
|
+
getCompanyById: typeof getCompanyById;
|
|
113
|
+
updateCompanyById: typeof updateCompanyById;
|
|
114
|
+
updateCompanyLogoById: typeof updateCompanyLogoById;
|
|
115
|
+
updateCompanyTaxInfoById: typeof updateCompanyTaxInfoById;
|
|
116
|
+
updateCompanyTaxInfoCertificates: typeof updateCompanyTaxInfoCertificates;
|
|
117
|
+
updateCFDIOrgLogo: typeof updateCFDIOrgLogo;
|
|
118
|
+
};
|
|
119
|
+
stripe: {
|
|
120
|
+
createCreateSuscriptionCheckoutSession: typeof createCreateSuscriptionCheckoutSession;
|
|
121
|
+
createCFDISuscrptionCheckoutSession: typeof createCFDISuscrptionCheckoutSession;
|
|
122
|
+
createCustomerPortalSession: typeof createCustomerPortalSession;
|
|
123
|
+
};
|
|
124
|
+
staff: {
|
|
125
|
+
getStoreStaff: typeof getStoreStaff;
|
|
126
|
+
getStoreStaffById: typeof getStoreStaffById;
|
|
127
|
+
updateStoreStaffById: typeof updateStoreStaffById;
|
|
128
|
+
createStoreStaff: typeof createStoreStaff;
|
|
129
|
+
deleteStoreStaffById: typeof deleteStoreStaffById;
|
|
130
|
+
};
|
|
131
|
+
discountCodes: {
|
|
132
|
+
getDiscountCodes: typeof getDiscountCodes;
|
|
133
|
+
getDiscountCodeById: typeof getDiscountCodeById;
|
|
134
|
+
verifyDiscountCode: typeof verifyDiscountCode;
|
|
135
|
+
createDiscountCode: typeof createDiscountCode;
|
|
136
|
+
deleteDiscountCodeById: typeof deleteDiscountCodeById;
|
|
137
|
+
};
|
|
138
|
+
automaticDiscount: {
|
|
139
|
+
getAutomaticDiscounts: typeof getAutomaticDiscounts;
|
|
140
|
+
getAutomaticDiscountById: typeof getAutomaticDiscountById;
|
|
141
|
+
createAutomaticDiscount: typeof createAutomaticDiscount;
|
|
142
|
+
deleteAutomaticDiscountById: typeof deleteAutomaticDiscountById;
|
|
143
|
+
};
|
|
144
|
+
csv: {
|
|
145
|
+
exportCustomersList: typeof csvExportEndpoints.getModule.exportCustomersList;
|
|
146
|
+
};
|
|
147
|
+
}
|