washday-sdk 0.0.144 → 0.0.145
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/post.js +15 -0
- package/dist/api/index.js +1 -0
- package/package.json +1 -1
- package/src/api/customers/post.ts +13 -0
- package/src/api/index.ts +1 -0
- package/src/interfaces/Api.ts +1 -0
|
@@ -24,3 +24,18 @@ export const create = function (data) {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
+
export const bulkCreate = function (storeId, data) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
try {
|
|
30
|
+
const config = {
|
|
31
|
+
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
32
|
+
};
|
|
33
|
+
const response = yield axiosInstance.put(`${GET_SET_CUSTOMERS}/bulk`, data, config);
|
|
34
|
+
return response.data || {};
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.error('Error fetching customers bulkCreate:', error);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
};
|
package/dist/api/index.js
CHANGED
|
@@ -118,6 +118,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
118
118
|
getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
|
|
119
119
|
getCustomerByIdCustomersApp: customersEndpoints.getModule.getCustomerByIdCustomersApp,
|
|
120
120
|
create: customersEndpoints.postModule.create,
|
|
121
|
+
bulkCreate: customersEndpoints.postModule.bulkCreate,
|
|
121
122
|
updateById: customersEndpoints.putModule.updateById,
|
|
122
123
|
deleteById: customersEndpoints.deleteModule.deleteById,
|
|
123
124
|
deleteByIdCustomersApp: customersEndpoints.deleteModule.deleteByIdCustomersApp,
|
package/package.json
CHANGED
|
@@ -33,3 +33,16 @@ export const create = async function (this: WashdayClientInstance, data: {
|
|
|
33
33
|
throw error;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
+
|
|
37
|
+
export const bulkCreate = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
|
|
38
|
+
try {
|
|
39
|
+
const config = {
|
|
40
|
+
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
41
|
+
};
|
|
42
|
+
const response = await axiosInstance.put(`${GET_SET_CUSTOMERS}/bulk`, data, config);
|
|
43
|
+
return response.data || {}
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error('Error fetching customers bulkCreate:', error);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
};
|
package/src/api/index.ts
CHANGED
|
@@ -124,6 +124,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
124
124
|
getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
|
|
125
125
|
getCustomerByIdCustomersApp: customersEndpoints.getModule.getCustomerByIdCustomersApp,
|
|
126
126
|
create: customersEndpoints.postModule.create,
|
|
127
|
+
bulkCreate: customersEndpoints.postModule.bulkCreate,
|
|
127
128
|
updateById: customersEndpoints.putModule.updateById,
|
|
128
129
|
deleteById: customersEndpoints.deleteModule.deleteById,
|
|
129
130
|
deleteByIdCustomersApp: customersEndpoints.deleteModule.deleteByIdCustomersApp,
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -110,6 +110,7 @@ export interface WashdayClientInstance {
|
|
|
110
110
|
getCustomerOrders: typeof customersEndpoints.getModule.getCustomerOrders;
|
|
111
111
|
getCustomerByIdCustomersApp: typeof customersEndpoints.getModule.getCustomerByIdCustomersApp;
|
|
112
112
|
create: typeof customersEndpoints.postModule.create;
|
|
113
|
+
bulkCreate: typeof customersEndpoints.postModule.bulkCreate;
|
|
113
114
|
updateById: typeof customersEndpoints.putModule.updateById;
|
|
114
115
|
deleteById: typeof customersEndpoints.deleteModule.deleteById;
|
|
115
116
|
deleteByIdCustomersApp: typeof customersEndpoints.deleteModule.deleteByIdCustomersApp;
|