@a-cube-io/ereceipts-js-sdk 2.2.1 → 2.2.2

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/index.cjs.js CHANGED
@@ -2534,6 +2534,12 @@ class AuthStrategy {
2534
2534
  return { mode: 'jwt', usePort444: false };
2535
2535
  }
2536
2536
  if (userRole === 'CASHIER') {
2537
+ if (url.includes('/inactivity-period')) {
2538
+ if (platform === 'mobile') {
2539
+ return { mode: 'mtls', usePort444: true };
2540
+ }
2541
+ return { mode: 'jwt', usePort444: true };
2542
+ }
2537
2543
  if (!isReceiptEndpoint) {
2538
2544
  return { mode: 'jwt', usePort444: false };
2539
2545
  }
@@ -4796,6 +4802,12 @@ class PointOfSaleMapper {
4796
4802
  pages: response.pages,
4797
4803
  };
4798
4804
  }
4805
+ static toInactivityApiInput(input) {
4806
+ return {
4807
+ start_at: input.startAt,
4808
+ end_at: input.endAt,
4809
+ };
4810
+ }
4799
4811
  }
4800
4812
 
4801
4813
  // this repository is used for MF1 endpoints
@@ -4824,8 +4836,9 @@ class PointOfSaleRepositoryImpl {
4824
4836
  async closeJournal(serialNumber) {
4825
4837
  await this.http.post(`/mf1/pems/${serialNumber}/close`);
4826
4838
  }
4827
- async createInactivity(serialNumber) {
4828
- await this.http.post(`/mf1/pems/${serialNumber}/inactivity`);
4839
+ async createInactivityPeriod(serialNumber, input) {
4840
+ const apiInput = PointOfSaleMapper.toInactivityApiInput(input);
4841
+ await this.http.post(`/mf1/pems/${serialNumber}/inactivity-period`, apiInput);
4829
4842
  }
4830
4843
  async communicateOffline(serialNumber, input) {
4831
4844
  const apiInput = PointOfSaleMapper.toOfflineApiInput(input);