washday-sdk 0.0.73 → 0.0.75

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 CHANGED
@@ -28,136 +28,129 @@ import * as productsEndpoints from './products';
28
28
  import * as customersEndpoints from './customers';
29
29
  import * as csvExportEndpoints from './csv';
30
30
  import * as ordersEndpoints from './order';
31
+ function bindMethods(instance, methods) {
32
+ const boundMethods = {};
33
+ for (const key in methods) {
34
+ if (methods.hasOwnProperty(key) && typeof methods[key] === 'function') {
35
+ boundMethods[key] = methods[key].bind(instance);
36
+ }
37
+ }
38
+ return boundMethods;
39
+ }
31
40
  const WashdayClient = function WashdayClient(apiToken) {
32
41
  this.apiToken = apiToken;
33
- WashdayClient.prototype.customers.apiToken = apiToken;
34
- WashdayClient.prototype.stores.apiToken = apiToken;
35
- WashdayClient.prototype.products.apiToken = apiToken;
36
- WashdayClient.prototype.users.apiToken = apiToken;
37
- WashdayClient.prototype.countries.apiToken = apiToken;
38
- WashdayClient.prototype.companies.apiToken = apiToken;
39
- WashdayClient.prototype.stripe.apiToken = apiToken;
40
- WashdayClient.prototype.staff.apiToken = apiToken;
41
- WashdayClient.prototype.cashierboxes.apiToken = apiToken;
42
- WashdayClient.prototype.discountCodes.apiToken = apiToken;
43
- WashdayClient.prototype.automaticDiscount.apiToken = apiToken;
44
- WashdayClient.prototype.sections.apiToken = apiToken;
45
- WashdayClient.prototype.supplies.apiToken = apiToken;
46
- WashdayClient.prototype.inventory.apiToken = apiToken;
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,
57
- };
58
- WashdayClient.prototype.customers = {
59
- getCustomers: customersEndpoints.getModule.getList,
60
- getCustomerById: customersEndpoints.getModule.getCustomerById,
61
- getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
62
- getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
63
- create: customersEndpoints.postModule.create,
64
- updateById: customersEndpoints.putModule.updateById,
65
- deleteById: customersEndpoints.deleteModule.deleteById,
66
- };
67
- WashdayClient.prototype.stores = {
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,
77
- };
78
- WashdayClient.prototype.products = {
79
- getById: productsEndpoints.getModule.getById,
80
- create: productsEndpoints.postModule.create,
81
- createProductSupply: productsEndpoints.postModule.createProductSupply,
82
- deleteById: productsEndpoints.deleteModule.deleteById,
83
- deleteProductSupplyById: productsEndpoints.deleteModule.deleteProductSupplyById,
84
- updateById: productsEndpoints.putModule.updateById,
85
- bulkUpdate: productsEndpoints.putModule.bulkUpdate
86
- };
87
- WashdayClient.prototype.users = {
88
- updateUserById: updateUserById,
89
- };
90
- WashdayClient.prototype.countries = {
91
- getCountries: getCountries,
92
- };
93
- WashdayClient.prototype.supplies = {
94
- getSupplies: getSupplies,
95
- getSupplyById: getSupplyById,
96
- getSupplyHistory: getSupplyHistory,
97
- createSupply: createSupply,
98
- updateSupplyById: updateSupplyById,
99
- addSupplyStock: addSupplyStock,
100
- deleteSupplyById: deleteSupplyById,
101
- };
102
- WashdayClient.prototype.sections = {
103
- getSections: sectionsEndpoints.getModule.getList,
104
- getById: sectionsEndpoints.getModule.getById,
105
- create: sectionsEndpoints.postModule.create,
106
- deleteById: sectionsEndpoints.deleteModule.deleteById,
107
- updateById: sectionsEndpoints.putModule.updateById,
108
- };
109
- WashdayClient.prototype.inventory = {
110
- getInventory: inventoryEndpoints.getModule.getInventory,
111
- getById: inventoryEndpoints.getModule.getInventoryById,
112
- getHistoryById: inventoryEndpoints.getModule.getHistoryById,
113
- create: inventoryEndpoints.postModule.create,
114
- deleteById: inventoryEndpoints.deleteModule.deleteById,
115
- updateById: inventoryEndpoints.putModule.updateById,
116
- addStock: inventoryEndpoints.putModule.addStock,
117
- };
118
- WashdayClient.prototype.cashierboxes = {
119
- getCashierboxesByStoreId: getCashierboxesByStoreId,
120
- getCashierboxesById: getCashierboxesById,
121
- getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
122
- createCashierBox: createCashierBox,
123
- updateCashierBoxById: updateCashierBoxById,
124
- deleteCashierBoxById: deleteCashierBoxById,
125
- addCashierBoxMovement: addCashierBoxMovement,
126
- };
127
- WashdayClient.prototype.companies = {
128
- getCompanyById: getCompanyById,
129
- updateCompanyById: updateCompanyById,
130
- updateCompanyLogoById: updateCompanyLogoById,
131
- updateCompanyTaxInfoById: updateCompanyTaxInfoById,
132
- updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
133
- updateCFDIOrgLogo: updateCFDIOrgLogo
134
- };
135
- WashdayClient.prototype.stripe = {
136
- createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
137
- createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
138
- createCustomerPortalSession: createCustomerPortalSession
139
- };
140
- WashdayClient.prototype.staff = {
141
- getStoreStaff: getStoreStaff,
142
- getStoreStaffById: getStoreStaffById,
143
- updateStoreStaffById: updateStoreStaffById,
144
- createStoreStaff: createStoreStaff,
145
- deleteStoreStaffById: deleteStoreStaffById,
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,
42
+ this.orders = bindMethods(this, {
43
+ getList: ordersEndpoints.getModule.getList,
44
+ getById: ordersEndpoints.getModule.getById,
45
+ updateById: ordersEndpoints.putModule.updateById,
46
+ updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
47
+ createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
48
+ deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
49
+ });
50
+ this.customers = bindMethods(this, {
51
+ getCustomers: customersEndpoints.getModule.getList,
52
+ getCustomerById: customersEndpoints.getModule.getCustomerById,
53
+ getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
54
+ getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
55
+ create: customersEndpoints.postModule.create,
56
+ updateById: customersEndpoints.putModule.updateById,
57
+ deleteById: customersEndpoints.deleteModule.deleteById,
58
+ });
59
+ this.stores = bindMethods(this, {
60
+ getStores: getStores,
61
+ getStoreById: getStoreById,
62
+ getStoreImages: getStoreImages,
63
+ createStore: createStore,
64
+ copyStore: copyStore,
65
+ updateStoreById: updateStoreById,
66
+ createStoreImage: createStoreImage,
67
+ getStoreReviewLink: getStoreReviewLink,
68
+ deleteStoreById: deleteStoreById,
69
+ });
70
+ this.products = bindMethods(this, {
71
+ getById: productsEndpoints.getModule.getById,
72
+ create: productsEndpoints.postModule.create,
73
+ createProductSupply: productsEndpoints.postModule.createProductSupply,
74
+ deleteById: productsEndpoints.deleteModule.deleteById,
75
+ deleteProductSupplyById: productsEndpoints.deleteModule.deleteProductSupplyById,
76
+ updateById: productsEndpoints.putModule.updateById,
77
+ bulkUpdate: productsEndpoints.putModule.bulkUpdate
78
+ });
79
+ this.users = bindMethods(this, {
80
+ updateUserById: updateUserById,
81
+ });
82
+ this.countries = bindMethods(this, {
83
+ getCountries: getCountries,
84
+ });
85
+ this.supplies = bindMethods(this, {
86
+ getSupplies: getSupplies,
87
+ getSupplyById: getSupplyById,
88
+ getSupplyHistory: getSupplyHistory,
89
+ createSupply: createSupply,
90
+ updateSupplyById: updateSupplyById,
91
+ addSupplyStock: addSupplyStock,
92
+ deleteSupplyById: deleteSupplyById,
93
+ });
94
+ this.sections = bindMethods(this, {
95
+ getSections: sectionsEndpoints.getModule.getList,
96
+ getById: sectionsEndpoints.getModule.getById,
97
+ create: sectionsEndpoints.postModule.create,
98
+ deleteById: sectionsEndpoints.deleteModule.deleteById,
99
+ updateById: sectionsEndpoints.putModule.updateById,
100
+ });
101
+ this.inventory = bindMethods(this, {
102
+ getInventory: inventoryEndpoints.getModule.getInventory,
103
+ getById: inventoryEndpoints.getModule.getInventoryById,
104
+ getHistoryById: inventoryEndpoints.getModule.getHistoryById,
105
+ create: inventoryEndpoints.postModule.create,
106
+ deleteById: inventoryEndpoints.deleteModule.deleteById,
107
+ updateById: inventoryEndpoints.putModule.updateById,
108
+ addStock: inventoryEndpoints.putModule.addStock,
109
+ });
110
+ this.cashierboxes = bindMethods(this, {
111
+ getCashierboxesByStoreId: getCashierboxesByStoreId,
112
+ getCashierboxesById: getCashierboxesById,
113
+ getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
114
+ createCashierBox: createCashierBox,
115
+ updateCashierBoxById: updateCashierBoxById,
116
+ deleteCashierBoxById: deleteCashierBoxById,
117
+ addCashierBoxMovement: addCashierBoxMovement,
118
+ });
119
+ this.companies = bindMethods(this, {
120
+ getCompanyById: getCompanyById,
121
+ updateCompanyById: updateCompanyById,
122
+ updateCompanyLogoById: updateCompanyLogoById,
123
+ updateCompanyTaxInfoById: updateCompanyTaxInfoById,
124
+ updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
125
+ updateCFDIOrgLogo: updateCFDIOrgLogo
126
+ });
127
+ this.stripe = bindMethods(this, {
128
+ createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
129
+ createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
130
+ createCustomerPortalSession: createCustomerPortalSession
131
+ });
132
+ this.staff = bindMethods(this, {
133
+ getStoreStaff: getStoreStaff,
134
+ getStoreStaffById: getStoreStaffById,
135
+ updateStoreStaffById: updateStoreStaffById,
136
+ createStoreStaff: createStoreStaff,
137
+ deleteStoreStaffById: deleteStoreStaffById,
138
+ });
139
+ this.discountCodes = bindMethods(this, {
140
+ getDiscountCodes: getDiscountCodes,
141
+ getDiscountCodeById: getDiscountCodeById,
142
+ verifyDiscountCode: verifyDiscountCode,
143
+ createDiscountCode: createDiscountCode,
144
+ deleteDiscountCodeById: deleteDiscountCodeById,
145
+ });
146
+ this.automaticDiscount = bindMethods(this, {
147
+ getAutomaticDiscounts: getAutomaticDiscounts,
148
+ getAutomaticDiscountById: getAutomaticDiscountById,
149
+ createAutomaticDiscount: createAutomaticDiscount,
150
+ deleteAutomaticDiscountById: deleteAutomaticDiscountById,
151
+ });
152
+ this.csv = bindMethods(this, {
153
+ exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
154
+ });
162
155
  };
163
156
  export default WashdayClient;
@@ -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 {
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
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,133 @@ 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
- };
38
- };
34
+ new(apiToken: string): WashdayClientInstance
35
+ };
36
+ function bindMethods<T>(instance: any, methods: any): T {
37
+ const boundMethods: any = {};
38
+ for (const key in methods) {
39
+ if (methods.hasOwnProperty(key) && typeof methods[key] === 'function') {
40
+ boundMethods[key] = methods[key].bind(instance);
41
+ }
42
+ }
43
+ return boundMethods;
44
+ }
39
45
 
40
46
  const WashdayClient: WashdayClientConstructor = function WashdayClient(this: WashdayClientInstance, apiToken: string) {
41
47
  this.apiToken = apiToken;
42
- WashdayClient.prototype.customers.apiToken = apiToken;
43
- WashdayClient.prototype.stores.apiToken = apiToken;
44
- WashdayClient.prototype.products.apiToken = apiToken;
45
- WashdayClient.prototype.users.apiToken = apiToken;
46
- WashdayClient.prototype.countries.apiToken = apiToken;
47
- WashdayClient.prototype.companies.apiToken = apiToken;
48
- WashdayClient.prototype.stripe.apiToken = apiToken;
49
- WashdayClient.prototype.staff.apiToken = apiToken;
50
- WashdayClient.prototype.cashierboxes.apiToken = apiToken;
51
- WashdayClient.prototype.discountCodes.apiToken = apiToken;
52
- WashdayClient.prototype.automaticDiscount.apiToken = apiToken;
53
- WashdayClient.prototype.sections.apiToken = apiToken;
54
- WashdayClient.prototype.supplies.apiToken = apiToken;
55
- WashdayClient.prototype.inventory.apiToken = apiToken;
56
- WashdayClient.prototype.csv.apiToken = apiToken;
57
- WashdayClient.prototype.orders.apiToken = apiToken;
48
+ this.orders = bindMethods(this, {
49
+ getList: ordersEndpoints.getModule.getList,
50
+ getById: ordersEndpoints.getModule.getById,
51
+ updateById: ordersEndpoints.putModule.updateById,
52
+ updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
53
+ createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
54
+ deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
55
+ });
56
+ this.customers = bindMethods(this, {
57
+ getCustomers: customersEndpoints.getModule.getList,
58
+ getCustomerById: customersEndpoints.getModule.getCustomerById,
59
+ getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
60
+ getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
61
+ create: customersEndpoints.postModule.create,
62
+ updateById: customersEndpoints.putModule.updateById,
63
+ deleteById: customersEndpoints.deleteModule.deleteById,
64
+ });
65
+ this.stores = bindMethods(this, {
66
+ getStores: getStores,
67
+ getStoreById: getStoreById,
68
+ getStoreImages: getStoreImages,
69
+ createStore: createStore,
70
+ copyStore: copyStore,
71
+ updateStoreById: updateStoreById,
72
+ createStoreImage: createStoreImage,
73
+ getStoreReviewLink: getStoreReviewLink,
74
+ deleteStoreById: deleteStoreById,
75
+ });
76
+ this.products = bindMethods(this, {
77
+ getById: productsEndpoints.getModule.getById,
78
+ create: productsEndpoints.postModule.create,
79
+ createProductSupply: productsEndpoints.postModule.createProductSupply,
80
+ deleteById: productsEndpoints.deleteModule.deleteById,
81
+ deleteProductSupplyById: productsEndpoints.deleteModule.deleteProductSupplyById,
82
+ updateById: productsEndpoints.putModule.updateById,
83
+ bulkUpdate: productsEndpoints.putModule.bulkUpdate
84
+ });
85
+ this.users = bindMethods(this, {
86
+ updateUserById: updateUserById,
87
+ });
88
+ this.countries = bindMethods(this, {
89
+ getCountries: getCountries,
90
+ });
91
+ this.supplies = bindMethods(this, {
92
+ getSupplies: getSupplies,
93
+ getSupplyById: getSupplyById,
94
+ getSupplyHistory: getSupplyHistory,
95
+ createSupply: createSupply,
96
+ updateSupplyById: updateSupplyById,
97
+ addSupplyStock: addSupplyStock,
98
+ deleteSupplyById: deleteSupplyById,
99
+ });
100
+ this.sections = bindMethods(this, {
101
+ getSections: sectionsEndpoints.getModule.getList,
102
+ getById: sectionsEndpoints.getModule.getById,
103
+ create: sectionsEndpoints.postModule.create,
104
+ deleteById: sectionsEndpoints.deleteModule.deleteById,
105
+ updateById: sectionsEndpoints.putModule.updateById,
106
+ });
107
+ this.inventory = bindMethods(this, {
108
+ getInventory: inventoryEndpoints.getModule.getInventory,
109
+ getById: inventoryEndpoints.getModule.getInventoryById,
110
+ getHistoryById: inventoryEndpoints.getModule.getHistoryById,
111
+ create: inventoryEndpoints.postModule.create,
112
+ deleteById: inventoryEndpoints.deleteModule.deleteById,
113
+ updateById: inventoryEndpoints.putModule.updateById,
114
+ addStock: inventoryEndpoints.putModule.addStock,
115
+ });
116
+ this.cashierboxes = bindMethods(this, {
117
+ getCashierboxesByStoreId: getCashierboxesByStoreId,
118
+ getCashierboxesById: getCashierboxesById,
119
+ getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
120
+ createCashierBox: createCashierBox,
121
+ updateCashierBoxById: updateCashierBoxById,
122
+ deleteCashierBoxById: deleteCashierBoxById,
123
+ addCashierBoxMovement: addCashierBoxMovement,
124
+ });
125
+ this.companies = bindMethods(this, {
126
+ getCompanyById: getCompanyById,
127
+ updateCompanyById: updateCompanyById,
128
+ updateCompanyLogoById: updateCompanyLogoById,
129
+ updateCompanyTaxInfoById: updateCompanyTaxInfoById,
130
+ updateCompanyTaxInfoCertificates: updateCompanyTaxInfoCertificates,
131
+ updateCFDIOrgLogo: updateCFDIOrgLogo
132
+ });
133
+ this.stripe = bindMethods(this, {
134
+ createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
135
+ createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
136
+ createCustomerPortalSession: createCustomerPortalSession
137
+ });
138
+ this.staff = bindMethods(this, {
139
+ getStoreStaff: getStoreStaff,
140
+ getStoreStaffById: getStoreStaffById,
141
+ updateStoreStaffById: updateStoreStaffById,
142
+ createStoreStaff: createStoreStaff,
143
+ deleteStoreStaffById: deleteStoreStaffById,
144
+ });
145
+ this.discountCodes = bindMethods(this, {
146
+ getDiscountCodes: getDiscountCodes,
147
+ getDiscountCodeById: getDiscountCodeById,
148
+ verifyDiscountCode: verifyDiscountCode,
149
+ createDiscountCode: createDiscountCode,
150
+ deleteDiscountCodeById: deleteDiscountCodeById,
151
+ });
152
+ this.automaticDiscount = bindMethods(this, {
153
+ getAutomaticDiscounts: getAutomaticDiscounts,
154
+ getAutomaticDiscountById: getAutomaticDiscountById,
155
+ createAutomaticDiscount: createAutomaticDiscount,
156
+ deleteAutomaticDiscountById: deleteAutomaticDiscountById,
157
+ });
158
+ this.csv = bindMethods(this, {
159
+ exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
160
+ });
58
161
  } as any;
59
162
 
60
- WashdayClient.prototype.orders = {
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;
163
+ export default WashdayClient;
@@ -1,10 +1,8 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
- import { ICustomer } from "../../interfaces/Customer";
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,
@@ -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: {
@@ -1,3 +1,147 @@
1
- export type WashdayClientInstance = {
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
+ }