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

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
@@ -2533,14 +2533,6 @@ class AuthStrategy {
2533
2533
  if (userRole === 'SUPPLIER') {
2534
2534
  return { mode: 'jwt', usePort444: false };
2535
2535
  }
2536
- if (url.includes('/download-data')) {
2537
- if (platform === 'mobile') {
2538
- return { mode: 'mtls', usePort444: true };
2539
- }
2540
- else {
2541
- return { mode: 'jwt', usePort444: true };
2542
- }
2543
- }
2544
2536
  if (userRole === 'CASHIER') {
2545
2537
  if (!isReceiptEndpoint) {
2546
2538
  return { mode: 'jwt', usePort444: false };
@@ -4786,7 +4778,7 @@ class PointOfSaleMapper {
4786
4778
  serialNumber: output.serial_number,
4787
4779
  status: output.status,
4788
4780
  address: AddressMapper.fromApi(output.address),
4789
- operationalStatus: output.operational_status,
4781
+ journalStatus: output.journal_status,
4790
4782
  };
4791
4783
  }
4792
4784
  static fromDetailedApiOutput(output) {
@@ -4806,6 +4798,7 @@ class PointOfSaleMapper {
4806
4798
  }
4807
4799
  }
4808
4800
 
4801
+ // this repository is used for MF1 endpoints
4809
4802
  class PointOfSaleRepositoryImpl {
4810
4803
  constructor(http) {
4811
4804
  this.http = http;
@@ -4838,6 +4831,12 @@ class PointOfSaleRepositoryImpl {
4838
4831
  const apiInput = PointOfSaleMapper.toOfflineApiInput(input);
4839
4832
  await this.http.post(`/mf1/pems/${serialNumber}/communicate-offline`, apiInput);
4840
4833
  }
4834
+ async downloadData(serialNumber) {
4835
+ const response = await this.http.get(`/mf1/pems/${serialNumber}/download-data`, {
4836
+ responseType: 'arraybuffer',
4837
+ });
4838
+ return response.data;
4839
+ }
4841
4840
  }
4842
4841
 
4843
4842
  class SupplierMapper {
@@ -4949,6 +4948,7 @@ class PemMapper {
4949
4948
  }
4950
4949
  }
4951
4950
 
4951
+ // this repository is used for MF2 endpoints
4952
4952
  class PemRepositoryImpl {
4953
4953
  constructor(http) {
4954
4954
  this.http = http;
@@ -4970,12 +4970,6 @@ class PemRepositoryImpl {
4970
4970
  const response = await this.http.get(`/mf2/pems/${serialNumber}/certificates`);
4971
4971
  return PemMapper.fromCertificatesApiOutput(response.data);
4972
4972
  }
4973
- async downloadData(serialNumber) {
4974
- const response = await this.http.get(`/mf1/pems/${serialNumber}/download-data`, {
4975
- responseType: 'arraybuffer',
4976
- });
4977
- return response.data;
4978
- }
4979
4973
  }
4980
4974
 
4981
4975
  class DailyReportMapper {