washday-sdk 0.0.196 → 0.0.197
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/customers/get.js +14 -0
- package/dist/api/index.js +1 -0
- package/package.json +1 -1
- package/src/api/customers/get.ts +13 -0
- package/src/api/index.ts +1 -0
- package/src/interfaces/Api.ts +1 -0
|
@@ -90,3 +90,17 @@ export const getCustomerByIdCustomersApp = function (customerId) {
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
};
|
|
93
|
+
export const getCustomerLoyaltyHistory = function (customerId) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
try {
|
|
96
|
+
const config = {
|
|
97
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
98
|
+
};
|
|
99
|
+
return yield axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/loyalty-history`, config);
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
console.error('Error fetching getCustomerLoyaltyHistory:', error);
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
};
|
package/dist/api/index.js
CHANGED
|
@@ -141,6 +141,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
141
141
|
getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
|
|
142
142
|
getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
|
|
143
143
|
getCustomerByIdCustomersApp: customersEndpoints.getModule.getCustomerByIdCustomersApp,
|
|
144
|
+
getCustomerLoyaltyHistory: customersEndpoints.getModule.getCustomerLoyaltyHistory,
|
|
144
145
|
create: customersEndpoints.postModule.create,
|
|
145
146
|
bulkCreate: customersEndpoints.postModule.bulkCreate,
|
|
146
147
|
updateById: customersEndpoints.putModule.updateById,
|
package/package.json
CHANGED
package/src/api/customers/get.ts
CHANGED
|
@@ -88,4 +88,17 @@ export const getCustomerByIdCustomersApp = async function (this: WashdayClientIn
|
|
|
88
88
|
console.error('Error fetching customer:', error);
|
|
89
89
|
throw error;
|
|
90
90
|
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
export const getCustomerLoyaltyHistory = async function (this: WashdayClientInstance, customerId: string): Promise<any> {
|
|
95
|
+
try {
|
|
96
|
+
const config = {
|
|
97
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
98
|
+
};
|
|
99
|
+
return await axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/loyalty-history`, config);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.error('Error fetching getCustomerLoyaltyHistory:', error);
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
91
104
|
};
|
package/src/api/index.ts
CHANGED
|
@@ -148,6 +148,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
148
148
|
getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
|
|
149
149
|
getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
|
|
150
150
|
getCustomerByIdCustomersApp: customersEndpoints.getModule.getCustomerByIdCustomersApp,
|
|
151
|
+
getCustomerLoyaltyHistory: customersEndpoints.getModule.getCustomerLoyaltyHistory,
|
|
151
152
|
create: customersEndpoints.postModule.create,
|
|
152
153
|
bulkCreate: customersEndpoints.postModule.bulkCreate,
|
|
153
154
|
updateById: customersEndpoints.putModule.updateById,
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -133,6 +133,7 @@ export interface WashdayClientInstance {
|
|
|
133
133
|
getCustomerHighlightsById: typeof customersEndpoints.getModule.getCustomerHighlightsById;
|
|
134
134
|
getCustomerOrders: typeof customersEndpoints.getModule.getCustomerOrders;
|
|
135
135
|
getCustomerByIdCustomersApp: typeof customersEndpoints.getModule.getCustomerByIdCustomersApp;
|
|
136
|
+
getCustomerLoyaltyHistory: typeof customersEndpoints.getModule.getCustomerLoyaltyHistory;
|
|
136
137
|
create: typeof customersEndpoints.postModule.create;
|
|
137
138
|
bulkCreate: typeof customersEndpoints.postModule.bulkCreate;
|
|
138
139
|
updateById: typeof customersEndpoints.putModule.updateById;
|