washday-sdk 0.0.112 → 0.0.114

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.
@@ -1,15 +1,25 @@
1
- "use strict";
2
- // import { WashdayClientInstance } from "../../interfaces/Api";
3
- // import axiosInstance from "../axiosInstance";
4
- // const GET_SET_ORDER_PAYMENTLINES = (orderId: string) => `/api/v2/order/${orderId}/paymentLines`;
5
- // export const deletePaymentLineById = async function (this: WashdayClientInstance, orderId: string, id: string): Promise<any> {
6
- // try {
7
- // const config = {
8
- // headers: { Authorization: `Bearer ${this.apiToken}` }
9
- // };
10
- // return await axiosInstance.delete(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, config);
11
- // } catch (error) {
12
- // console.error('Error fetching deleteById:', error);
13
- // throw error;
14
- // }
15
- // };
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import axiosInstance from "../axiosInstance";
11
+ const GET_CASH_UP_REPORTS = 'api/cashupreports';
12
+ export const deleteCashUpReport = function (storeId, id) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ try {
15
+ const config = {
16
+ headers: { Authorization: `Bearer ${this.apiToken}` }
17
+ };
18
+ return yield axiosInstance.get(`${GET_CASH_UP_REPORTS}/${storeId}/${id}`, config);
19
+ }
20
+ catch (error) {
21
+ console.error('Error fetching:', error);
22
+ throw error;
23
+ }
24
+ });
25
+ };
@@ -1,4 +1,4 @@
1
- // export * as deleteModule from './delete';
1
+ export * as deleteModule from './delete';
2
2
  export * as getModule from './get';
3
3
  export * as postModule from './post';
4
4
  // export * as putModule from './put';
package/dist/api/index.js CHANGED
@@ -48,7 +48,8 @@ const WashdayClient = function WashdayClient(apiToken) {
48
48
  getList: cashupsEndpoints.getModule.getList,
49
49
  getById: cashupsEndpoints.getModule.getById,
50
50
  getPreviewDataForCashClose: cashupsEndpoints.getModule.getPreviewDataForCashClose,
51
- create: cashupsEndpoints.postModule.create
51
+ create: cashupsEndpoints.postModule.create,
52
+ deleteCashUpReport: cashupsEndpoints.deleteModule.deleteCashUpReport
52
53
  });
53
54
  this.cfdi = bindMethods(this, {
54
55
  getList: cfdiEndpoints.getModule.getList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.112",
3
+ "version": "0.0.114",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,15 +1,15 @@
1
- // import { WashdayClientInstance } from "../../interfaces/Api";
2
- // import axiosInstance from "../axiosInstance";
3
- // const GET_SET_ORDER_PAYMENTLINES = (orderId: string) => `/api/v2/order/${orderId}/paymentLines`;
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import axiosInstance from "../axiosInstance";
3
+ const GET_CASH_UP_REPORTS = 'api/cashupreports';
4
4
 
5
- // export const deletePaymentLineById = async function (this: WashdayClientInstance, orderId: string, id: string): Promise<any> {
6
- // try {
7
- // const config = {
8
- // headers: { Authorization: `Bearer ${this.apiToken}` }
9
- // };
10
- // return await axiosInstance.delete(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, config);
11
- // } catch (error) {
12
- // console.error('Error fetching deleteById:', error);
13
- // throw error;
14
- // }
15
- // };
5
+ export const deleteCashUpReport = async function (this: WashdayClientInstance, storeId: string, id: string): Promise<any> {
6
+ try {
7
+ const config = {
8
+ headers: { Authorization: `Bearer ${this.apiToken}` }
9
+ };
10
+ return await axiosInstance.get(`${GET_CASH_UP_REPORTS}/${storeId}/${id}`, config);
11
+ } catch (error) {
12
+ console.error('Error fetching:', error);
13
+ throw error;
14
+ }
15
+ }
@@ -1,4 +1,4 @@
1
- // export * as deleteModule from './delete';
1
+ export * as deleteModule from './delete';
2
2
  export * as getModule from './get';
3
3
  export * as postModule from './post';
4
4
  // export * as putModule from './put';
package/src/api/index.ts CHANGED
@@ -54,7 +54,8 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
54
54
  getList: cashupsEndpoints.getModule.getList,
55
55
  getById: cashupsEndpoints.getModule.getById,
56
56
  getPreviewDataForCashClose: cashupsEndpoints.getModule.getPreviewDataForCashClose,
57
- create: cashupsEndpoints.postModule.create
57
+ create: cashupsEndpoints.postModule.create,
58
+ deleteCashUpReport: cashupsEndpoints.deleteModule.deleteCashUpReport
58
59
  });
59
60
  this.cfdi = bindMethods(this, {
60
61
  getList: cfdiEndpoints.getModule.getList,
@@ -40,7 +40,8 @@ export interface WashdayClientInstance {
40
40
  getList: typeof cashupsEndpoints.getModule.getList;
41
41
  getById: typeof cashupsEndpoints.getModule.getById;
42
42
  getPreviewDataForCashClose: typeof cashupsEndpoints.getModule.getPreviewDataForCashClose;
43
- create: typeof cashupsEndpoints.postModule.create
43
+ create: typeof cashupsEndpoints.postModule.create,
44
+ deleteCashUpReport: typeof cashupsEndpoints.deleteModule.deleteCashUpReport,
44
45
  }
45
46
  cfdi: {
46
47
  getList: typeof cfdiEndpoints.getModule.getList,